]> code.delx.au - gnu-emacs/blobdiff - src/w32proc.c
[HAVE_NTGUI]: Include w32term.h.
[gnu-emacs] / src / w32proc.c
index e7834d6a452ce41f89d92f5d2f467355631d8169..1aa5a0cc6bb434606b20b4bbcc24f557ad0e367b 100644 (file)
@@ -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)