http://bugs.winehq.org/show_bug.cgi?id=22338
Summary: spawnl(P_WAIT, "...") and system() do not wait if a host program is invoked Product: Wine Version: unspecified Platform: x86 OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: msvcrt AssignedTo: wine-bugs@winehq.org ReportedBy: bonzini@gnu.org
Sample program:
#include <stdio.h> #include <stdlib.h>
int main(int argc, char **argv) { int i; if (argc == 2) system (argv[1]); for (i = 0; i < 10000; i++) puts (argc == 2 ? "a" : "b"); }
Compile it for both Windows and Linux:
gcc test.c i686-pc-mingw32-gcc test.c
Now, running a Windows child process will correctly wait for the child process to finish:
$ ./a.exe ./a.exe |uniq b a
Instead, Wine will not wait for a Linux child process to finish:
$ ./a.exe ./a.out |uniq a b a
I _think_ i can work around the bug by wrapping the Unix program with a wrapper that links to libwine, but I am not yet sure.