summaryrefslogtreecommitdiff
path: root/vms
diff options
context:
space:
mode:
authorJohn E. Malmberg <wb8tyw@qsl.net>2006-03-20 03:12:19 -0500
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2006-03-21 10:49:14 +0000
commit704c2eb32539845568269483e091b89ae0793748 (patch)
tree14e5f17e36a339721201f91634cd168a3ae39b13 /vms
parent7e7a3dfc0d3c74b10a066568a904a5a10013d5e4 (diff)
downloadperl-704c2eb32539845568269483e091b89ae0793748.tar.gz
[patch@27538] utime patch for VMS
From: "John E. Malmberg" <wb8tyw@qsl.net> Message-ID: <441EAA33.6010603@qsl.net> p4raw-id: //depot/perl@27561
Diffstat (limited to 'vms')
-rw-r--r--vms/vms.c21
-rw-r--r--vms/vmsish.h6
2 files changed, 26 insertions, 1 deletions
diff --git a/vms/vms.c b/vms/vms.c
index ea25085d49..05b4ce948e 100644
--- a/vms/vms.c
+++ b/vms/vms.c
@@ -9740,12 +9740,31 @@ int Perl_my_utime(pTHX_ const char *file, const struct utimbuf *utimes)
devdsc = {0,DSC$K_DTYPE_T, DSC$K_CLASS_S,0},
fnmdsc = {0,DSC$K_DTYPE_T, DSC$K_CLASS_S,0};
+ if (decc_efs_charset != 0) {
+ struct utimbuf utc_utimes;
+
+ utc_utimes.actime = utimes->actime;
+ utc_utimes.modtime = utimes->modtime;
+# ifdef VMSISH_TIME
+ /* If input was local; convert to UTC for sys svc */
+ if (VMSISH_TIME) {
+ utc_utimes.actime = _toutc(utimes->actime);
+ utc_utimes.modtime = _toutc(utimes->modtime);
+ }
+# endif
+ sts = utime(file, &utc_utimes);
+ return sts;
+ }
+
if (file == NULL || *file == '\0') {
set_errno(ENOENT);
set_vaxc_errno(LIB$_INVARG);
return -1;
}
- if (do_tovmsspec(file,vmsspec,0) == NULL) return -1;
+
+ /* Convert to VMS format ensuring that it will fit in 255 characters */
+ if (do_rmsexpand(file, vmsspec, 0, NULL, PERL_RMSEXPAND_M_VMS) == NULL)
+ return -1;
if (utimes != NULL) {
/* Convert Unix time (seconds since 01-JAN-1970 00:00:00.00)
diff --git a/vms/vmsish.h b/vms/vmsish.h
index 2c8bacecd3..6dc97a4be2 100644
--- a/vms/vmsish.h
+++ b/vms/vmsish.h
@@ -464,12 +464,18 @@ struct interp_intern {
# include <signal.h>
#define ABORT() abort()
+#ifdef I_UTIME
+#include <utime.h>
+#else
/* Used with our my_utime() routine in vms.c */
struct utimbuf {
time_t actime;
time_t modtime;
};
+#endif
+#ifndef DONT_MASK_RTL_CALLS
#define utime my_utime
+#endif
/* This is what times() returns, but <times.h> calls it tbuffer_t on VMS
* prior to v7.0. We check the DECC manifest to see whether it's already