summaryrefslogtreecommitdiffstats
path: root/win/tclWinPipe.c
diff options
context:
space:
mode:
authorpatthoyts <patthoyts@users.sourceforge.net>2005-11-04 18:33:34 (GMT)
committerpatthoyts <patthoyts@users.sourceforge.net>2005-11-04 18:33:34 (GMT)
commit841c2af7dcfcd20b68bd3f05f5ecce6498b35a18 (patch)
treeb1bf11da1526f8870771f95b77002ca9960b2793 /win/tclWinPipe.c
parent05f6317032522fa4b68966fe3c1ef854d87fbf6e (diff)
downloadtcl-841c2af7dcfcd20b68bd3f05f5ecce6498b35a18.zip
tcl-841c2af7dcfcd20b68bd3f05f5ecce6498b35a18.tar.gz
tcl-841c2af7dcfcd20b68bd3f05f5ecce6498b35a18.tar.bz2
* win/tclWinPipe.c: Applied patch #1267871 by Matt Newman which
* win/tclWinPort.h: provides extended error code support. * tests/exec.test: Wrote some tests for this feature.
Diffstat (limited to 'win/tclWinPipe.c')
-rw-r--r--win/tclWinPipe.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/win/tclWinPipe.c b/win/tclWinPipe.c
index dc9a917..8dc41d0 100644
--- a/win/tclWinPipe.c
+++ b/win/tclWinPipe.c
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclWinPipe.c,v 1.33.2.14 2005/07/28 15:27:59 dkf Exp $
+ * RCS: @(#) $Id: tclWinPipe.c,v 1.33.2.15 2005/11/04 18:33:35 patthoyts Exp $
*/
#include "tclWinInt.h"
@@ -2576,12 +2576,12 @@ Tcl_WaitPid(
case EXCEPTION_FLT_UNDERFLOW:
case EXCEPTION_INT_DIVIDE_BY_ZERO:
case EXCEPTION_INT_OVERFLOW:
- *statPtr = SIGFPE;
+ *statPtr = 0xC0000000 | SIGFPE;
break;
case EXCEPTION_PRIV_INSTRUCTION:
case EXCEPTION_ILLEGAL_INSTRUCTION:
- *statPtr = SIGILL;
+ *statPtr = 0xC0000000 | SIGILL;
break;
case EXCEPTION_ACCESS_VIOLATION:
@@ -2592,28 +2592,24 @@ Tcl_WaitPid(
case EXCEPTION_INVALID_DISPOSITION:
case EXCEPTION_GUARD_PAGE:
case EXCEPTION_INVALID_HANDLE:
- *statPtr = SIGSEGV;
+ *statPtr = 0xC0000000 | SIGSEGV;
break;
case CONTROL_C_EXIT:
- *statPtr = SIGINT;
+ *statPtr = 0xC0000000 | SIGINT;
break;
default:
- *statPtr = SIGABRT;
+ *statPtr = 0xC0000000 | SIGABRT;
break;
}
} else {
- /*
- * Non exception, normal, exit code. Note that the exit code
- * is truncated to a byte range.
- */
- *statPtr = ((exitCode << 8) & 0xff00);
+ *statPtr = exitCode;
}
result = pid;
} else {
errno = ECHILD;
- *statPtr = ECHILD;
+ *statPtr = 0xC0000000 | ECHILD;
result = (Tcl_Pid) -1;
}