1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-04-20 21:11:18 -07:00

(win32_wait): fixed bad synch_process_retcode

and initialized synch_process_death if signaled.
This commit is contained in:
Geoff Voelker 1996-01-04 03:07:38 +00:00
parent 48717ed41d
commit 3d7eead0b5

View file

@ -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 @@ remove_child (child_process *cp)
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 @@ win32_wait (int *status)
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);