mirror of
https://git.code.sf.net/p/mingw-w64/mingw-w64
synced 2024-11-27 11:54:24 +08:00
Fix mkstemp implementation
When closing the file handle obtained from mkstemp(), the file ought _not_ to be deleted. Patch by Jan Engelhardt <jengelh@inai.de>
This commit is contained in:
parent
4c13e3f141
commit
76119a8e89
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user