summaryrefslogtreecommitdiff
path: root/vms
diff options
context:
space:
mode:
authorCraig A. Berry <craigberry@mac.com>2009-01-15 13:46:02 -0600
committerCraig A. Berry <craigberry@mac.com>2009-01-15 13:46:02 -0600
commit98c7875d3485f5c773ff1976f4197e346535dabc (patch)
treef9b149b4168e2be6a78c30139c60ac530574d822 /vms
parent6fb6c61459e9cc9e8f46103f192d73975cf22ea1 (diff)
downloadperl-98c7875d3485f5c773ff1976f4197e346535dabc.tar.gz
Fix handling of DECC$DISABLE_POSIX_ROOT feature on VMS.
The nomenclature is confusing and the CRTL docs even moreso, and the CRTL implementation seems not to do what the docs say. The documented default setting is on, which I take to mean that processing of SYS$POSIX_ROOT is disabled unless you have asked for it. I've followed this behavior even though the CRTL seems to report the feature off by default. Also corrected yet another length error in a related call to simple_trnlnm.
Diffstat (limited to 'vms')
-rw-r--r--vms/vms.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/vms/vms.c b/vms/vms.c
index b8ac795fbe..ba47da4ca8 100644
--- a/vms/vms.c
+++ b/vms/vms.c
@@ -9454,7 +9454,6 @@ void
vms_image_init(int *argcp, char ***argvp)
{
int status;
- char val_str[10];
char eqv[LNM$C_NAMLENGTH+1] = "";
unsigned int len, tabct = 8, tabidx = 0;
unsigned long int *mask, iosb[2], i, rlst[128], rsz;
@@ -9475,16 +9474,18 @@ vms_image_init(int *argcp, char ***argvp)
/* This was moved from the pre-image init handler because on threaded */
/* Perl it was always returning 0 for the default value. */
- status = simple_trnlnm("SYS$POSIX_ROOT", val_str, sizeof(val_str));
+ status = simple_trnlnm("SYS$POSIX_ROOT", eqv, LNM$C_NAMLENGTH);
if (status > 0) {
int s;
s = decc$feature_get_index("DECC$DISABLE_POSIX_ROOT");
if (s > 0) {
int initial;
initial = decc$feature_get_value(s, 4);
- if (initial >= 0) {
- /* initial is -1 if nothing has set the feature */
- /* initial is 1 if the logical name is present */
+ if (initial > 0) {
+ /* initial is: 0 if nothing has set the feature */
+ /* -1 if initialized to default */
+ /* 1 if set by logical name */
+ /* 2 if set by decc$feature_set_value */
decc_disable_posix_root = decc$feature_get_value(s, 1);
/* If the value is not valid, force the feature off */
@@ -9494,7 +9495,7 @@ vms_image_init(int *argcp, char ***argvp)
}
}
else {
- /* Traditionally Perl assumes this is off */
+ /* Nothing has asked for it explicitly, so use our own default. */
decc_disable_posix_root = 1;
decc$feature_set_value(s, 1, 1);
}