# HG changeset patch # User Geoff Voelker # Date 820724858 0 # Node ID c80fb27c183ba1dcc6de3ccdf90304cdba06bd97 # Parent badba571804fe54062e2d3865a1b930f58ead9a3 (win32_wait): fixed bad synch_process_retcode and initialized synch_process_death if signaled. diff -r badba571804f -r c80fb27c183b src/w32proc.c --- a/src/w32proc.c Thu Jan 04 03:05:24 1996 +0000 +++ b/src/w32proc.c Thu Jan 04 03:07:38 1996 +0000 @@ -34,6 +34,12 @@ #include "lisp.h" #include "nt.h" #include "systime.h" +#include "syswait.h" +#include "process.h" + +#ifndef SYS_SIGLIST_DECLARED +extern char *sys_siglist[]; +#endif /* #define FULL_DEBUG */ @@ -330,10 +336,6 @@ When it does, close its handle Return the pid and fill in the status if non-NULL. */ -/* From callproc.c */ -extern int synch_process_alive; -extern int synch_process_retcode; - int win32_wait (int *status) { @@ -423,8 +425,25 @@ else if (synch_process_alive) { synch_process_alive = 0; - synch_process_retcode = retval; + /* Report the status of the synchronous process. */ + if (WIFEXITED (retval)) + synch_process_retcode = WRETCODE (retval); + else if (WIFSIGNALED (retval)) + { + int code = WTERMSIG (retval); + char *signame = 0; + + if (code < NSIG) + { + /* Suppress warning if the table has const char *. */ + signame = (char *) sys_siglist[code]; + } + if (signame == 0) + signame = "unknown"; + + synch_process_death = signame; + } TerminateThread (cp->thrd, 0); CloseHandle (cp->thrd); CloseHandle (cp->char_consumed);