Hi, mingw-w64's current mkstemp implementation wrongly uses _O_TEMPORARY which doesn't make sense. Here is a patch from openSUSE we apply to fix it:
From: Jan Engelhardt <[email protected]> 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; ------------------------------------------------------------------------------ Site24x7 APM Insight: Get Deep Visibility into Application Performance APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month Monitor end-to-end web transactions and take corrective actions now Troubleshoot faster and improve end-user experience. Signup Now! http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140 _______________________________________________ Mingw-w64-public mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
