diff options
| author | Geoff Voelker | 1996-01-04 03:07:38 +0000 |
|---|---|---|
| committer | Geoff Voelker | 1996-01-04 03:07:38 +0000 |
| commit | 3d7eead0b594494671cc29554dc170b918e1b3f2 (patch) | |
| tree | 5900a026f0fbb723818e18bc8b64c3fdceb080a5 /src/w32proc.c | |
| parent | 48717ed41d3da59cf80600ba942191ee75d9992d (diff) | |
| download | emacs-3d7eead0b594494671cc29554dc170b918e1b3f2.tar.gz emacs-3d7eead0b594494671cc29554dc170b918e1b3f2.zip | |
(win32_wait): fixed bad synch_process_retcode
and initialized synch_process_death if signaled.
Diffstat (limited to 'src/w32proc.c')
| -rw-r--r-- | src/w32proc.c | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/src/w32proc.c b/src/w32proc.c index 8e8d986f38c..b2df278a0dc 100644 --- a/src/w32proc.c +++ b/src/w32proc.c | |||
| @@ -34,6 +34,12 @@ | |||
| 34 | #include "lisp.h" | 34 | #include "lisp.h" |
| 35 | #include "nt.h" | 35 | #include "nt.h" |
| 36 | #include "systime.h" | 36 | #include "systime.h" |
| 37 | #include "syswait.h" | ||
| 38 | #include "process.h" | ||
| 39 | |||
| 40 | #ifndef SYS_SIGLIST_DECLARED | ||
| 41 | extern char *sys_siglist[]; | ||
| 42 | #endif | ||
| 37 | 43 | ||
| 38 | /* #define FULL_DEBUG */ | 44 | /* #define FULL_DEBUG */ |
| 39 | 45 | ||
| @@ -330,10 +336,6 @@ remove_child (child_process *cp) | |||
| 330 | When it does, close its handle | 336 | When it does, close its handle |
| 331 | Return the pid and fill in the status if non-NULL. */ | 337 | Return the pid and fill in the status if non-NULL. */ |
| 332 | 338 | ||
| 333 | /* From callproc.c */ | ||
| 334 | extern int synch_process_alive; | ||
| 335 | extern int synch_process_retcode; | ||
| 336 | |||
| 337 | int | 339 | int |
| 338 | win32_wait (int *status) | 340 | win32_wait (int *status) |
| 339 | { | 341 | { |
| @@ -423,8 +425,25 @@ win32_wait (int *status) | |||
| 423 | else if (synch_process_alive) | 425 | else if (synch_process_alive) |
| 424 | { | 426 | { |
| 425 | synch_process_alive = 0; | 427 | synch_process_alive = 0; |
| 426 | synch_process_retcode = retval; | ||
| 427 | 428 | ||
| 429 | /* Report the status of the synchronous process. */ | ||
| 430 | if (WIFEXITED (retval)) | ||
| 431 | synch_process_retcode = WRETCODE (retval); | ||
| 432 | else if (WIFSIGNALED (retval)) | ||
| 433 | { | ||
| 434 | int code = WTERMSIG (retval); | ||
| 435 | char *signame = 0; | ||
| 436 | |||
| 437 | if (code < NSIG) | ||
| 438 | { | ||
| 439 | /* Suppress warning if the table has const char *. */ | ||
| 440 | signame = (char *) sys_siglist[code]; | ||
| 441 | } | ||
| 442 | if (signame == 0) | ||
| 443 | signame = "unknown"; | ||
| 444 | |||
| 445 | synch_process_death = signame; | ||
| 446 | } | ||
| 428 | TerminateThread (cp->thrd, 0); | 447 | TerminateThread (cp->thrd, 0); |
| 429 | CloseHandle (cp->thrd); | 448 | CloseHandle (cp->thrd); |
| 430 | CloseHandle (cp->char_consumed); | 449 | CloseHandle (cp->char_consumed); |