2016-03-01 15:25 GMT+01:00 Dongsheng Song <[email protected]>:
>
> On Tue, Mar 1, 2016 at 8:42 PM, Ismail Donmez <[email protected]> wrote:
>
>> 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.
>>
>
> Why did you make such assertion ?
>
> I can not see such statement in POSIX, Linux, FreeBSD or OpenBSD:
>
> http://pubs.opengroup.org/onlinepubs/009695399/functions/mkstemp.html
> http://man7.org/linux/man-pages/man3/mkstemp.3.html
> https://www.freebsd.org/cgi/man.cgi?query=mkstemp
> http://www.openbsd.org/cgi-bin/man.cgi/OpenBSD-current/man3/mkdtemp.3
>
There is also no a priori reason to delete it. POSIX also gives an as-if
clause in the latest version of the document you linked:
http://pubs.opengroup.org/onlinepubs/9699919799/
open(pathname, O_RDWR|O_CREAT|O_EXCL, S_IRUSR|S_IWUSR)
Which does not include the Windows-specific _O_TEMPORARY as in MinGW-w64.
Why do you think deleting it is an added value? This function can therefore
also used to create a file that will later be moved, see e.g.
http://stackoverflow.com/a/12008368/256138
So, IMHO, the patch is correct.
Ruben
>
>
>
> ------------------------------------------------------------------------------
> 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
>
>
------------------------------------------------------------------------------
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