aboutsummaryrefslogtreecommitdiffstats
path: root/e_os.h
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2016-01-13 17:00:22 +0100
committerRichard Levitte <levitte@openssl.org>2016-01-13 18:06:46 +0100
commitc3944a9947df7f41f85e27c24c2e6402c51235c3 (patch)
tree9a5844b017797da5d9d719c01d3e22965e1e7d22 /e_os.h
parentb97c8c0ef235425b56a4313a4de1b80a0266cfb8 (diff)
downloadopenssl-c3944a9947df7f41f85e27c24c2e6402c51235c3.tar.gz
Have the VMS exit code follow POSIX conventions
It seems like the convention for VMS exit codes is to combine the VMS C facility code (0x35a000) with a recoded exit code as follows: 0 => 1 1-255 => 8*code + 2 We also add 0x10000000, which is the control bit that has DCL not report the error on the terminal. That's just as well, since it would be quite nonsensical, for example: %C-W-NOMSG, Message number 0035A018 We could do all this by using the normal exit() function after having defined the macro _POSIX_EXIT. Unfortunately, this feature only exists in VMS C V7.1 and up. Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'e_os.h')
-rw-r--r--e_os.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/e_os.h b/e_os.h
index 5ab4c89a70..8c644bf132 100644
--- a/e_os.h
+++ b/e_os.h
@@ -377,6 +377,13 @@ extern FILE *_imp___iob;
So, what we do here is to change 0 to 1 to get the default success status,
and everything else is shifted up to fit into the status number field, and
the status is tagged as an error, which I believe is what is wanted here.
+
+ Finally, we add the VMS C facility code 0x35a000, because there are some
+ programs, such as Perl, that will reinterpret the code back to something
+ POSIXly. 'man perlvms' explains it further.
+ NOTE: the perlvms manual wants to turn all codes 2 to 255 into success
+ codes (status type = 1). I couldn't disagree more. Fortunately, the
+ status type doesn't seem to bother Perl.
-- Richard Levitte
*/
# define EXIT(n) do { int __VMS_EXIT = n; \
@@ -385,6 +392,7 @@ extern FILE *_imp___iob;
else \
__VMS_EXIT = (n << 3) | 2; \
__VMS_EXIT |= 0x10000000; \
+ __VMS_EXIT |= 0x35a000; \
exit(__VMS_EXIT); } while(0)
# define NO_SYS_PARAM_H
# define NO_SYS_UN_H