http://bugs.winehq.org/show_bug.cgi?id=2554
Summary: Freopen() fails "invalid argument" Product: Wine Version: 20041019 Platform: Other URL: http://www.afn.org/~wilson/foo.exe OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: wine-binary AssignedTo: wine-bugs@winehq.org ReportedBy: wilson@afn.org
Environment: mingw w. gcc 2.9.95 as xcompiler under Linux.
Following tiny program fails under Wine, but succeeds under WXP. If you trust me, executable is available at referenced URL. Invoke it (or your compiled equivalent):
wine foo foo.exe
(or use any existing file as foo's argument).
#include <stdio.h> #include <errno.h> main(int argc, char* argv[]) { FILE* f; if (argc <= 1) return 0;
if (f = freopen(argv[1], "rb", stdin)) printf("freopen() worked\n"); else printf("Oh, no! errno=%d\n", errno);
return 0; }
NOTE: I have another application where freopen(...) is called much later. This application seems to work!?