[openssl-commits] [openssl] master update
Richard Levitte
levitte at openssl.org
Wed Jan 13 17:07:36 UTC 2016
The branch master has been updated
via aa1477926769dcdf839f8fccd9db79847899aa86 (commit)
via c3944a9947df7f41f85e27c24c2e6402c51235c3 (commit)
from b97c8c0ef235425b56a4313a4de1b80a0266cfb8 (commit)
- Log -----------------------------------------------------------------
commit aa1477926769dcdf839f8fccd9db79847899aa86
Author: Richard Levitte <levitte at openssl.org>
Date: Wed Jan 13 17:04:19 2016 +0100
Don't return from main(), use EXIT() instead
Reviewed-by: Rich Salz <rsalz at openssl.org>
commit c3944a9947df7f41f85e27c24c2e6402c51235c3
Author: Richard Levitte <levitte at openssl.org>
Date: Wed Jan 13 17:00:22 2016 +0100
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 at openssl.org>
-----------------------------------------------------------------------
Summary of changes:
apps/openssl.c | 2 +-
e_os.h | 8 ++++++++
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/apps/openssl.c b/apps/openssl.c
index 6bd14ff..4f2ba8c 100644
--- a/apps/openssl.c
+++ b/apps/openssl.c
@@ -432,7 +432,7 @@ int main(int argc, char *argv[])
CRYPTO_mem_leaks(bio_err);
#endif
BIO_free(bio_err);
- return (ret);
+ EXIT(ret);
}
OPTIONS exit_options[] = {
diff --git a/e_os.h b/e_os.h
index 5ab4c89..8c644bf 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
More information about the openssl-commits
mailing list