From 247aae8b846c40f679021a927636c01300356850ac41a786660a384d7fac2413 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Tue, 31 Mar 2015 17:05:48 +0000 Subject: [PATCH] Add mkstemp.diff OBS-URL: https://build.opensuse.org/package/show/windows:mingw:win64/mingw64-runtime?expand=0&rev=36 --- mingw64-runtime.changes | 6 ++++++ mingw64-runtime.spec | 2 ++ mkstemp.diff | 23 +++++++++++++++++++++++ 3 files changed, 31 insertions(+) create mode 100644 mkstemp.diff diff --git a/mingw64-runtime.changes b/mingw64-runtime.changes index 1bf5cdf..5beb5c6 100644 --- a/mingw64-runtime.changes +++ b/mingw64-runtime.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Mar 31 16:59:00 UTC 2015 - jengelh@inai.de + +- Add mkstemp.diff, addressing broken behavior of mkstemp(), + a newly implemented function since mingw 4.0.1. + ------------------------------------------------------------------- Thu Mar 26 22:48:14 UTC 2015 - jengelh@inai.de diff --git a/mingw64-runtime.spec b/mingw64-runtime.spec index 4e23675..1a42ce9 100644 --- a/mingw64-runtime.spec +++ b/mingw64-runtime.spec @@ -27,6 +27,7 @@ Url: http://mingw-w64.sf.net/ #DL-URL: http://downloads.sf.net/mingw-w64/mingw-w64-%version.tar.bz2 Source: mingw-w64-crt-%version.tar.xz Source100: %{name}-rpmlintrc +Patch1: mkstemp.diff #!BuildIgnore: post-build-checks BuildRequires: mingw64-cross-binutils BuildRequires: mingw64-cross-gcc-bootstrap >= 4.4.0 @@ -50,6 +51,7 @@ MinGW Win64 cross-compiler runtime, base libraries. %prep %setup -q -n mingw-w64-crt +%patch -P 1 -p1 %build %{_mingw64_configure} --disable-lib32 --enable-lib64 diff --git a/mkstemp.diff b/mkstemp.diff new file mode 100644 index 0000000..d0ab560 --- /dev/null +++ b/mkstemp.diff @@ -0,0 +1,23 @@ +From: Jan Engelhardt +Date: 2015-03-31 18:57:45.887248277 +0200 +References: https://sourceforge.net/p/mingw-w64/bugs/471/ + +When closing the file handle obtained from mkstemp(), the file +ought _not_ to be deleted. +--- + misc/mkstemp.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +Index: mingw-w64-crt/misc/mkstemp.c +=================================================================== +--- mingw-w64-crt.orig/misc/mkstemp.c ++++ mingw-w64-crt/misc/mkstemp.c +@@ -48,7 +48,7 @@ int __cdecl mkstemp (char *template_name + template_name[j] = letters[rand () % 62]; + } + fd = _sopen(template_name, +- _O_RDWR | _O_CREAT | _O_EXCL | _O_TEMPORARY | _O_BINARY, ++ _O_RDWR | _O_CREAT | _O_EXCL | _O_BINARY, + _SH_DENYRW, _S_IREAD | _S_IWRITE); + if (fd != -1) return fd; + if (fd == -1 && errno != EEXIST) return -1;