From bc69349bba9310f4cb65022f9e8f81698b758abd Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Mon, 19 Jun 1995 23:20:42 +0000 Subject: [PATCH] (win32_wait): Massage retval into what is expected in Unix. --- src/w32proc.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/w32proc.c b/src/w32proc.c index e7834d6a452..1aa5a0cc6bb 100644 --- a/src/w32proc.c +++ b/src/w32proc.c @@ -395,7 +395,16 @@ win32_wait (int *status) errno = EINVAL; return -1; } - + + /* Massage the exit code from the process to match the format expected + by the WIFSTOPPED et al macros in syswait.h. Only WIFSIGNALLED and + WIFEXITED are supported; WIFSTOPPED doesn't make sense under NT. */ + + if (retval == STATUS_CONTROL_C_EXIT) + retval = SIGINT; + else + retval <<= 8; + cp = cps[active]; if (status) -- 2.39.2