Change 27561 by [EMAIL PROTECTED] on 2006/03/21 10:49:14

        Subject: [EMAIL PROTECTED] utime patch for VMS
        From: "John E. Malmberg" <[EMAIL PROTECTED]>
        Date: Mon, 20 Mar 2006 08:12:19 -0500
        Message-ID: <[EMAIL PROTECTED]>

Affected files ...

... //depot/perl/configure.com#231 edit
... //depot/perl/vms/vms.c#169 edit
... //depot/perl/vms/vmsish.h#78 edit

Differences ...

==== //depot/perl/configure.com#231 (text) ====
Index: perl/configure.com
--- perl/configure.com#230~27407~       2006-03-07 14:16:55.000000000 -0800
+++ perl/configure.com  2006-03-21 02:49:14.000000000 -0800
@@ -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'"

==== //depot/perl/vms/vms.c#169 (text) ====
Index: perl/vms/vms.c
--- perl/vms/vms.c#168~27554~   2006-03-20 05:03:07.000000000 -0800
+++ perl/vms/vms.c      2006-03-21 02:49:14.000000000 -0800
@@ -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)

==== //depot/perl/vms/vmsish.h#78 (text) ====
Index: perl/vms/vmsish.h
--- perl/vms/vmsish.h#77~27187~ 2006-02-14 20:32:14.000000000 -0800
+++ perl/vms/vmsish.h   2006-03-21 02:49:14.000000000 -0800
@@ -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
End of Patch.

Reply via email to