In vmsish.h:

* Fix a typo for vms specific st_fab_mrs macro that was not noticed because currently nothing uses it.

* Create macros VMS_INO_T_COMPARE and VMS_INO_T_COPY to hide difference from traditional VMS specific ino_t array type and standard 64 bit ino_t type.


In vms.c:

1. Set default to have /dev/null work around active until it can be verified that the problem is fixed. The logical name DECC_BUG_DEVNULL can be used to deactivate the work around.

2. Convert all ino_t compares or assignments to use the macros in vmsish.h.

3. Fix the test for /dev/null to only check the first 9 characters.


-John
[EMAIL PROTECTED]
Personal Opinion Only
--- /rsync_root/perl/vms/vms.c  Sat Jan 14 00:20:09 2006
+++ vms/vms.c   Sun Jan 29 22:04:27 2006
@@ -246,7 +246,7 @@
 
 /* bug workarounds if needed */
 int decc_bug_readdir_efs1 = 0;
-int decc_bug_devnull = 0;
+int decc_bug_devnull = 1;
 int decc_bug_fgetname = 0;
 int decc_dir_barename = 0;
 
@@ -3127,11 +3127,7 @@
     if (!fp) return 0;
     fstat(fileno(fp), (struct stat *)&s1);
 
-    #if defined(_USE_STD_STAT)
-      cmp_result = s0.crtl_stat.st_ino != s1.crtl_stat.st_ino;
-    #else
-      cmp_result = memcmp(s0.crtl_stat.st_ino, s1.crtl_stat.st_ino, 6);
-    #endif
+    cmp_result = VMS_INO_T_COMPARE(s0.crtl_stat.st_ino, s1.crtl_stat.st_ino);
     if ((cmp_result != 0) && (s0.st_ctime != s1.st_ctime))  {
         fclose(fp);
         return 0;
@@ -9504,7 +9500,7 @@
     const char *name;
 {
   if (decc_bug_devnull != 0) {
-    if (strcmp("/dev/null", name) == 0) /* temp hack */
+    if (strncmp("/dev/null", name, 9) == 0)
       return 1;
   }
     /* The VMS null device is named "_NLA0:", usually abbreviated as "NL:".
@@ -9702,11 +9698,8 @@
        if (cptr == NULL)
           namecache[0] = '\0';
     }
-#ifdef _USE_STD_STAT
-    memcpy(&statbufp->st_ino, &statbufp->crtl_stat.st_ino, 8);
-#else
-    memcpy(&statbufp->st_ino, statbufp->crtl_stat.st_ino, 8);
-#endif
+
+    VMS_INO_T_COPY(statbufp->st_ino, statbufp->crtl_stat.st_ino);
 #ifndef _USE_STD_STAT
     strncpy(statbufp->st_devnam, statbufp->crtl_stat.st_dev, 63);
     statbufp->st_devnam[63] = 0;
@@ -9822,11 +9815,7 @@
   }
 #endif
     if (!retval) {
-#ifdef _USE_STD_STAT
-      memcpy(&statbufp->st_ino, &statbufp->crtl_stat.st_ino, 8);
-#else
-      memcpy(&statbufp->st_ino, statbufp->crtl_stat.st_ino, 8);
-#endif
+      VMS_INO_T_COPY(statbufp->st_ino, statbufp->crtl_stat.st_ino);
 #ifndef _USE_STD_STAT
       strncpy(statbufp->st_devnam, statbufp->crtl_stat.st_dev, 63);
       statbufp->st_devnam[63] = 0;
@@ -10890,11 +10879,13 @@
     }
 
     /* PCP mode requires creating /dev/null special device file */
-    decc_bug_devnull = 0;
+    decc_bug_devnull = 1;
     status = sys_trnlnm("DECC_BUG_DEVNULL", val_str, sizeof(val_str));
     if ($VMS_STATUS_SUCCESS(status)) {
        if ((val_str[0] == 'E') || (val_str[0] == '1') || (val_str[0] == 'T'))
           decc_bug_devnull = 1;
+       else
+         decc_bug_devnull = 0;
     }
 
     /* fgetname returning a VMS name in UNIX mode */
--- /rsync_root/perl/vms/vmsish.h       Sat Jan 14 00:04:36 2006
+++ vms/vmsish.h        Sun Jan 29 17:57:30 2006
@@ -677,7 +677,15 @@
 #define st_fab_rfm crtl_stat.st_fab_rfm
 #define st_fab_rat crtl_stat.st_fab_rat
 #define st_fab_fsz crtl_stat.st_fab_fsz
-#define st_fab_mrs crtl_stat_st_fab_mrs
+#define st_fab_mrs crtl_stat.st_fab_mrs
+
+#ifdef _USE_STD_STAT
+#define VMS_INO_T_COMPARE(__a, __b) (__a != __b)
+#define VMS_INO_T_COPY(__a, __b) a = b
+#else
+#define VMS_INO_T_COMPARE(__a, __b) memcmp(&__a, &__b, 6)
+#define VMS_INO_T_COPY(__a, __b) memcpy(&__a, &__b, 6)
+#endif
 
 #if defined(__DECC) || defined(__DECCXX)
 #  pragma __member_alignment __restore

Reply via email to