The patch changes the utime emulation in vms.c to handle pathnames longer than 255 characters when the rest of that support is enabled.

It also changes the Perl_my_utime() call to use the real utime() call when the DECC$_EFS_CHARSET feature is enabled so that the times of a file on an ODS-5 volume can be properly set.

Changed files:

Configure.com - Detect utime.h header file and configure accordingly.

vms/vmsish.h - If utime.h header file exists, use it, to make sure that the structure is properly aligned. Do not hide the utime() function from vms.c.

vms/vms.c - If DECC$_EFS_CHARSET enabled, use built in utime() function instead of emulation, and convert the input times from local to utc if the vmsish pragma is set. Also use rmsexpand() instead of tovmsspec() to convert the path name to VMS, as rmsexpand() makes sure that the resulting VMS file specification will fit in 255 characters.

-John
[EMAIL PROTECTED]
Personal Opinion Only
--- /rsync_root/perl/configure.com      Tue Mar  7 17:18:01 2006
+++ configure.com       Sun Mar 19 20:53:21 2006
@@ -3512,6 +3512,13 @@
 $ GOSUB inhdr
 $ i_unistd = tmp
 $!
+$! Check to see if we've got utime.h (which we should use if we have)
+$!
+$ i_netdb = "undef"
+$ tmp = "utime.h"
+$ GOSUB inhdr
+$ i_utime = tmp
+$!
 $! do we have getppid()?
 $!
 $ IF i_unistd .EQS. "define"
@@ -6113,7 +6120,7 @@
 $ WC "i_time='define'"
 $ WC "i_unistd='" + i_unistd + "'"
 $ WC "i_ustat='undef'"
-$ WC "i_utime='undef'"
+$ WC "i_utime='" + i_utime + "'"
 $ WC "i_values='undef'"
 $ WC "i_varargs='undef'"
 $ WC "i_vfork='undef'"
--- vms/vms.c_existing  Sun Mar 19 22:33:20 2006
+++ vms/vms.c   Sun Mar 19 23:13:33 2006
@@ -9740,12 +9740,31 @@
                         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)
--- /rsync_root/perl/vms/vmsish.h       Tue Feb 14 23:32:29 2006
+++ vms/vmsish.h        Sun Mar 19 22:35:35 2006
@@ -464,12 +464,18 @@
 # 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

Reply via email to