summaryrefslogtreecommitdiff
path: root/perl.h
diff options
context:
space:
mode:
authorJohn E. Malmberg <wb8tyw@qsl.net>2008-11-08 18:46:03 -0600
committerCraig A. Berry <craigberry@mac.com>2008-11-10 12:49:23 +0000
commit1a3aec58bbfe991c5f6d394fa59ab18b857bba6c (patch)
treea543401c400fbea94059b32d7f16f07e0c66e92b /perl.h
parentb306dcb39875d351d64f81a4a6469b778b8f7c42 (diff)
downloadperl-1a3aec58bbfe991c5f6d394fa59ab18b857bba6c.tar.gz
[patch@34779] Get posix exit mode working/tested on VMS
From: "John E. Malmberg" <wb8tyw@qsl.net> Message-id: <4916872B.5040500@qsl.net> p4raw-id: //depot/perl@34790
Diffstat (limited to 'perl.h')
-rw-r--r--perl.h16
1 files changed, 10 insertions, 6 deletions
diff --git a/perl.h b/perl.h
index 526155b5b7..d08a4a6a21 100644
--- a/perl.h
+++ b/perl.h
@@ -2941,9 +2941,9 @@ typedef pthread_key_t perl_key;
PL_statusvalue_vms == SS$_NORMAL; \
else \
if (MY_POSIX_EXIT) \
- PL_statusvalue_vms = \
- (C_FAC_POSIX | (evalue << 3 ) | (evalue == 1)? \
- (STS$K_ERROR | STS$M_INHIB_MSG) : 1); \
+ PL_statusvalue_vms = \
+ (C_FAC_POSIX | (evalue << 3 ) | \
+ ((evalue == 1) ? (STS$K_ERROR | STS$M_INHIB_MSG) : 1)); \
else \
PL_statusvalue_vms = SS$_ABORT; \
} else { /* forgive them Perl, for they have sinned */ \
@@ -2969,6 +2969,9 @@ typedef pthread_key_t perl_key;
* actual exit code will can be retrieved by the calling program or
* shell.
*
+ * A POSIX exit code is from 0 to 255. If the exit code is higher
+ * than this, it needs to be assumed that it is a VMS exit code and
+ * passed through.
*/
# define STATUS_EXIT_SET(n) \
@@ -2976,9 +2979,10 @@ typedef pthread_key_t perl_key;
I32 evalue = (I32)n; \
PL_statusvalue = evalue; \
if (MY_POSIX_EXIT) \
- PL_statusvalue_vms = \
- (C_FAC_POSIX | (evalue << 3 ) | (evalue == 1)? \
- (STS$K_ERROR | STS$M_INHIB_MSG) : 1); \
+ if (evalue > 255) PL_statusvalue_vms = evalue; else { \
+ PL_statusvalue_vms = \
+ (C_FAC_POSIX | (evalue << 3 ) | \
+ ((evalue == 1) ? (STS$K_ERROR | STS$M_INHIB_MSG) : 1));} \
else \
PL_statusvalue_vms = evalue ? evalue : SS$_NORMAL; \
set_vaxc_errno(PL_statusvalue_vms); \