diff options
author | John E. Malmberg <wb8tyw@qsl.net> | 2008-11-08 18:46:03 -0600 |
---|---|---|
committer | Craig A. Berry <craigberry@mac.com> | 2008-11-10 12:49:23 +0000 |
commit | 1a3aec58bbfe991c5f6d394fa59ab18b857bba6c (patch) | |
tree | a543401c400fbea94059b32d7f16f07e0c66e92b /vms/vms.c | |
parent | b306dcb39875d351d64f81a4a6469b778b8f7c42 (diff) | |
download | perl-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 'vms/vms.c')
-rw-r--r-- | vms/vms.c | 25 |
1 files changed, 17 insertions, 8 deletions
@@ -353,6 +353,7 @@ static int vms_process_case_tolerant = 1; int vms_vtf7_filenames = 0; int gnv_unix_shell = 0; static int vms_unlink_all_versions = 0; +static int vms_posix_exit = 0; /* bug workarounds if needed */ int decc_bug_readdir_efs1 = 0; @@ -13080,9 +13081,7 @@ Perl_sys_intern_init(pTHX) VMSISH_HUSHED = 0; - /* fix me later to track running under GNV */ - /* this allows some limited testing */ - MY_POSIX_EXIT = decc_filename_unix_report; + MY_POSIX_EXIT = vms_posix_exit; x = (float)ix; MY_INV_RAND_MAX = 1./x; @@ -13556,7 +13555,6 @@ static int set_features gnv_unix_shell = 0; status = sys_trnlnm("GNV$UNIX_SHELL", val_str, sizeof(val_str)); if ($VMS_STATUS_SUCCESS(status)) { - if ((val_str[0] == 'E') || (val_str[0] == '1') || (val_str[0] == 'T')) { gnv_unix_shell = 1; set_feature_default("DECC$EFS_CASE_PRESERVE", 1); set_feature_default("DECC$EFS_CHARSET", 1); @@ -13565,9 +13563,7 @@ static int set_features set_feature_default("DECC$READDIR_DROPDOTNOTYPE", 1); set_feature_default("DECC$DISABLE_POSIX_ROOT", 0); vms_unlink_all_versions = 1; - } - else - gnv_unix_shell = 0; + vms_posix_exit = 1; } #endif @@ -13638,8 +13634,10 @@ static int set_features s = decc$feature_get_index("DECC$FILENAME_UNIX_REPORT"); if (s >= 0) { decc_filename_unix_report = decc$feature_get_value(s, 1); - if (decc_filename_unix_report > 0) + if (decc_filename_unix_report > 0) { decc_filename_unix_report = 1; + vms_posix_exit = 1; + } else decc_filename_unix_report = 0; } @@ -13767,6 +13765,17 @@ static int set_features #endif + /* USE POSIX/DCL Exit codes - Recommended, but needs to default to */ + /* for strict backward compatibilty */ + status = sys_trnlnm + ("PERL_VMS_POSIX_EXIT", val_str, sizeof(val_str)); + if ($VMS_STATUS_SUCCESS(status)) { + if ((val_str[0] == 'E') || (val_str[0] == '1') || (val_str[0] == 'T')) + vms_posix_exit = 1; + else + vms_posix_exit = 0; + } + /* CRTL can be initialized past this point, but not before. */ /* DECC$CRTL_INIT(); */ |