http://bugs.winehq.org/show_bug.cgi?id=33715
Bug #: 33715 Summary: freopen produces empty file when applied to stdout (regression from wine-1.5.19 to wine-1.5.31) Product: Wine Version: 1.5.31 Platform: x86-64 OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: msvcrt AssignedTo: wine-bugs@winehq.org ReportedBy: irwin@beluga.phys.uvic.ca Classification: Unclassified
Created attachment 44648 --> http://bugs.winehq.org/attachment.cgi?id=44648 test case which shows freopen does not work for wine-1.5.31
The issue is illustrated by the attached test_freopen.c file which freopens stdout to the file test_freopen.stdout, then writes "Hello World\n" to stdout. For Wine-1.5.19, the resulting test_freopen.stdout contains the "Hello World\n" test string, but for Wine-1.5.31 (with e5bebe26253f2725141a35f23b6f2e10fc7694d and f565e4a3157d38b50a25fc3b90014474b59fceba reverted to work around bug 33654) that file is empty.
Since stdout is involved, this may be related to bug 33654 which is also a regression between 1.5.19 and 1.5.31 reported by me. However, the current bug is different in the sense that the workaround for bug 33654 (applied above) does not work in this case.