summaryrefslogtreecommitdiff
path: root/perl.h
diff options
context:
space:
mode:
authorChip Salzenberg <chip@perl.com>1997-02-04 11:16:46 +1200
committerChip Salzenberg <chip@atlantic.net>1997-02-11 07:29:00 +1200
commit91e9c03fe206e18256c19e5e5628ca536e8b1fd6 (patch)
treec02b0679ff373a4ead204eeb469dcf8d434490a8 /perl.h
parent046ff0edbba626fc32c37c08cfba99cfeef41b6d (diff)
downloadperl-91e9c03fe206e18256c19e5e5628ca536e8b1fd6.tar.gz
Fix value of system() and $? for DEC UNIX, VMS, others
Diffstat (limited to 'perl.h')
-rw-r--r--perl.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/perl.h b/perl.h
index f91179a669..d267f2032c 100644
--- a/perl.h
+++ b/perl.h
@@ -444,7 +444,12 @@
#endif
#define STATUS_POSIX statusvalue
-#define STATUS_POSIX_SET(n) (statusvalue = (n))
+#define STATUS_POSIX_SET(n) \
+ STMT_START { \
+ statusvalue = (n); \
+ if (statusvalue != -1) \
+ statusvalue &= 0xFFFF; \
+ } STMT_END
#ifdef VMS
# define STATUS_NATIVE statusvalue_vms
@@ -468,8 +473,8 @@
# define STATUS_NATIVE STATUS_POSIX
# define STATUS_NATIVE_EXPORT STATUS_POSIX
# define STATUS_NATIVE_SET STATUS_POSIX_SET
-# define STATUS_ALL_SUCCESS STATUS_POSIX_SET(0)
-# define STATUS_ALL_FAILURE STATUS_POSIX_SET(1)
+# define STATUS_ALL_SUCCESS (statusvalue = 0)
+# define STATUS_ALL_FAILURE (statusvalue = 1)
#endif
#ifdef I_SYS_IOCTL
@@ -1712,7 +1717,7 @@ IEXT STRLEN Iorslen;
IEXT char * Iofmt; /* $# */
IEXT I32 Imaxsysfd IINIT(MAXSYSFD); /* top fd to pass to subprocesses */
IEXT int Imultiline; /* $*--do strings hold >1 line? */
-IEXT U32 Istatusvalue; /* $? */
+IEXT I32 Istatusvalue; /* $? */
#ifdef VMS
IEXT U32 Istatusvalue_vms; /* $^S */
#endif