From: Gurusamy Sarathy Date: Wed, 24 Dec 1997 04:59:28 +0000 (+0000) Subject: [win32] make $? Unix (and ActiveWare) compatible X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=aeb2b38d3110f132d105d762f8f59dd6e1564741;p=p5sagit%2Fp5-mst-13.2.git [win32] make $? Unix (and ActiveWare) compatible p4raw-id: //depot/win32/perl@388 --- diff --git a/README.win32 b/README.win32 index 3727b2c..1b596eb 100644 --- a/README.win32 +++ b/README.win32 @@ -524,10 +524,9 @@ functionality of ioctlsocket() in the Winsock API). =item * -C<$?> ends up with the exitstatus of the subprocess (this is different -from Unix, where the exitstatus is actually given by "$? >> 8"). -Failure to spawn() the subprocess is indicated by setting $? to -"255<<8". This is subject to change. +C<$?> is set in a way compatible with Unix, so the exitstatus of the +subprocess is actually obtained by "$? >> 8". Failure to spawn() the +subprocess is indicated by setting $? to "255 << 8". =item * diff --git a/win32/win32.c b/win32/win32.c index 8f96611..f75ec6c 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -259,9 +259,9 @@ do_aspawn(void* really, void ** mark, void ** arglast) if (status < 0) { if (dowarn) warn("Can't spawn \"%s\": %s", cmd, strerror(errno)); - status = 255 << 8; + status = 255; } - return (status); + return (statusvalue = status*256); } int @@ -341,9 +341,9 @@ do_spawn2(char *cmd, int exectype) (exectype == EXECF_EXEC ? "exec" : "spawn"), needToTry ? shell : argv[0], strerror(errno)); - status = 255 << 8; + status = 255; } - return (status); + return (statusvalue = status*256); } int