Menu

#471 mkstemp implementation broken in mingw4

v1.0 (example)
open
nobody
None
5
2016-03-30
2015-03-31
No

mingw 4.0.1 introduced misc/mkstemp.c. This implementation uses _O_TEMPORARY, which causes the file to be deleted when closed. This behavior is incompatible with what applications expect of mkstemp(). Remove the flag.

Discussion

  • Hendrik Leppkes

    Hendrik Leppkes - 2015-12-01

    Can this issue be fixed? I'm manually patching my mingw-w64 now because of the fallout from this when building even gcc and binutils et al.

     
  • Shiro Kawai

    Shiro Kawai - 2015-12-27

    I just got stumbled by this problem. This breaks the idiom of writing out to the temporary file, close it, then rename it to the final filename.

    Curious that if there's a particular reason that this issue hasn't been addressed by seemingly innocent fix of removing the flag.

     
  • Jan Engelhardt

    Jan Engelhardt - 2015-12-27

    Someone probably needs to make the mailing list aware of this posted issue.

     
  • Shiro Kawai

    Shiro Kawai - 2015-12-27

    Reasonable. I just found a patch is posted recently: https://sourceforge.net/p/mingw-w64/mailman/message/34665524/ Let's see how it goes.

     
  • Jan Engelhardt

    Jan Engelhardt - 2016-03-30

    it landed in 5.0~rc2.

     

Log in to post a comment.