X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=pipex_win32.c;h=0bbf990282a9c1195ae5c63ec638efc93f995c9c;hb=471c4c42e267be298ce20951d5a352acd6b55190;hp=5b18b06fc2b08b8bf75eac63ed2191c1aef3a2a5;hpb=cd81270f2b1723e0798f4d6dcaee134f0b4aca7f;p=polyglot.git diff --git a/pipex_win32.c b/pipex_win32.c index 5b18b06..0bbf990 100644 --- a/pipex_win32.c +++ b/pipex_win32.c @@ -72,6 +72,8 @@ void pipex_open(pipex_t *pipex, char *szCurrentDir; pipex->state=0; pipex->name=szName; + pipex->command=szProcFile; + pipex->quit_pending=FALSE; pipex->hProcess=NULL; if (szProcFile == NULL) { pipex->hInput = GetStdHandle(STD_INPUT_HANDLE); @@ -99,7 +101,7 @@ void pipex_open(pipex_t *pipex, my_fatal("pipex_open(): cannot change directory: %s\n", strerror(errno)); } - if(CreateProcess(NULL, + if(CreateProcess(NULL, (LPSTR) szProcFile, NULL, NULL, @@ -194,7 +196,11 @@ void pipex_exit(pipex_t *pipex) { DWORD lpexit; CloseHandle(pipex->hInput); CloseHandle(pipex->hOutput); - + if(!pipex->quit_pending){ + // suppress further errors + pipex->quit_pending=TRUE; + my_fatal("pipex_exit(): %s: child exited unexpectedly.\n",pipex->command); + } if(GetExitCodeProcess(pipex->hProcess,&lpexit)){ if(lpexit==STILL_ACTIVE) //must be java,hammer it down!