summaryrefslogtreecommitdiff
path: root/vms
diff options
context:
space:
mode:
authorCraig A. Berry <craigberry@mac.com>2006-05-31 03:19:27 +0000
committerCraig A. Berry <craigberry@mac.com>2006-05-31 03:19:27 +0000
commitcb9e088c6c9544c1bc6cedfb8b1b58aed8d6ae7b (patch)
tree55fb3f9f0f30514a15220b54b12d55e53e5509ec /vms
parent9b494a7e378ba156401fa90333424582b0fcf907 (diff)
downloadperl-cb9e088c6c9544c1bc6cedfb8b1b58aed8d6ae7b.tar.gz
Make VMS-specific device name encoding routine say no more politely.
p4raw-id: //depot/perl@28339
Diffstat (limited to 'vms')
-rw-r--r--vms/vms.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/vms/vms.c b/vms/vms.c
index 1237be017a..f6f8e0689c 100644
--- a/vms/vms.c
+++ b/vms/vms.c
@@ -9820,7 +9820,7 @@ int Perl_my_utime(pTHX_ const char *file, const struct utimbuf *utimes)
*
* A better method might be to use sys$device_scan on the first call, and to
* search for the device, returning an index into the cached array.
- * The number returned would be more intelligable.
+ * The number returned would be more intelligible.
* This is probably not worth it, and anyway would take quite a bit longer
* on the first call.
*/
@@ -9838,7 +9838,7 @@ static mydev_t encode_dev (pTHX_ const char *dev)
#if LOCKID_MASK
{
struct dsc$descriptor_s dev_desc;
- unsigned long int status, lockid, item = DVI$_LOCKID;
+ unsigned long int status, lockid = 0, item = DVI$_LOCKID;
/* For cluster-mounted disks, the disk lock identifier is unique, so we
can try that first. */
@@ -9846,7 +9846,16 @@ static mydev_t encode_dev (pTHX_ const char *dev)
dev_desc.dsc$b_dtype = DSC$K_DTYPE_T;
dev_desc.dsc$b_class = DSC$K_CLASS_S;
dev_desc.dsc$a_pointer = (char *) dev; /* Read only parameter */
- _ckvmssts(lib$getdvi(&item, 0, &dev_desc, &lockid, 0, 0));
+ status = lib$getdvi(&item, 0, &dev_desc, &lockid, 0, 0);
+ if (!(status & 1)) {
+ switch (status) {
+ case SS$_NOSUCHDEV:
+ SETERRNO(ENODEV, status);
+ return 0;
+ default:
+ _ckvmssts(status);
+ }
+ }
if (lockid) return (lockid & ~LOCKID_MASK);
}
#endif