Re: [Mingw-w64-public] [PATCH] headers: _FORTIFY_SOURCE: Add _[w][s]open() and [s]open().

2019-09-30 Thread Liu Hao
在 2019/9/29 22:31, Christian Franke 写道: > Calling open("foo", O_WRONLY|O_CREAT) without 3rd argument may > (pseudo-)randomly set FILE_ATTRIBUTE_READONLY on the new file. With the > attached patch, the attribute is always set in this case to show that > something is wrong. A compile time warning is

[Mingw-w64-public] [PATCH] headers: _FORTIFY_SOURCE: Add _[w][s]open() and [s]open().

2019-09-29 Thread Christian Franke
Calling open("foo", O_WRONLY|O_CREAT) without 3rd argument may (pseudo-)randomly set FILE_ATTRIBUTE_READONLY on the new file. With the attached patch, the attribute is always set in this case to show that something is wrong. A compile time warning is printed if possible. I'm not yet sure how