I stumbled onto this while using freopen() for debugging purposes.
Basically, freopen() fails if the FILE has been created with
an invalid handle.
So, this MR contains:
- basic tests for freopen (no issue there, just for coverage purposes)
- tests for freopen on FILE with invalid handle
- fix for freopen
--
v3: msvcrt: Fix freopen() on FILE with invalid underlying fd.
msvcrt/tests: Add tests for freopen().
https://gitlab.winehq.org/wine/wine/-/merge_requests/3578
On Wed Aug 16 20:20:19 2023 +0000, Jacek Caban wrote:
> One way or another, tests of a global state like that will always be
> theoretically a subject to race. In essence, my patch reduces problem
> probability, just like your solution.
Which is why a general solution would be better than N different hacks.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3577#note_42592