X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=pipex_win32.c;h=0bbf990282a9c1195ae5c63ec638efc93f995c9c;hb=471c4c42e267be298ce20951d5a352acd6b55190;hp=a07df7d676ad0828fb6bbb1c4667a6d2dae610aa;hpb=446bfd706349c3e1f19916a16558a2f4f7dc8e54;p=polyglot.git diff --git a/pipex_win32.c b/pipex_win32.c index a07df7d..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, @@ -118,7 +120,7 @@ void pipex_open(pipex_t *pipex, pipex->bConsole = FALSE; pipex->bPipe=TRUE; }else{ - my_fatal("pipex_open(): %s",win32_error()); + my_fatal("pipex_open(): %s: %s",szProcFile,win32_error()); } _chdir(szCurrentDir); } @@ -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!