2
0
Jan Engelhardt 2015-03-31 17:05:52 +00:00 committed by Git OBS Bridge
parent 02787182d3
commit 3d7f1d5570
3 changed files with 31 additions and 0 deletions

View File

@ -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

View File

@ -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: mingw32-cross-binutils
BuildRequires: mingw32-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
%{_mingw32_configure} --enable-lib32 --disable-lib64

23
mkstemp.diff Normal file
View File

@ -0,0 +1,23 @@
From: Jan Engelhardt <jengelh@inai.de>
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;