Fix a couple compile issues.
authorWayne Davison <wayned@samba.org>
Mon, 14 Mar 2011 02:12:15 +0000 (19:12 -0700)
committerWayne Davison <wayned@samba.org>
Mon, 14 Mar 2011 04:30:04 +0000 (21:30 -0700)
crtimes.diff

index 9d6754faefda5766ac551a262b9252d308a251b9..cc7bf8f2415b29b3a0c0bebd7d453fa0a5022c35 100644 (file)
@@ -5,7 +5,8 @@ To use this patch, run these commands for a successful build:
 
     patch -p1 <patches/fileflags.diff
     patch -p1 <patches/crtimes.diff
-    ./configure                      (optional if already run)
+    ./prepare-source
+    ./configure
     make
 
 based-on: patch/b3.0.x/fileflags
@@ -90,7 +91,7 @@ diff --git a/flist.c b/flist.c
        static mode_t mode;
  #ifdef SUPPORT_FILEFLAGS
        static uint32 fileflags;
-@@ -754,6 +764,8 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x
+@@ -758,6 +768,8 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x
                                uid = F_OWNER(first);
                        if (preserve_gid)
                                gid = F_GROUP(first);
@@ -99,7 +100,7 @@ diff --git a/flist.c b/flist.c
                        if (preserve_devices && IS_DEVICE(mode)) {
                                uint32 *devp = F_RDEV_P(first);
                                rdev = MAKEDEV(DEV_MAJOR(devp), DEV_MINOR(devp));
-@@ -782,6 +794,19 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x
+@@ -786,6 +798,19 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x
                } else
                        modtime = read_int(f);
        }
@@ -119,7 +120,7 @@ diff --git a/flist.c b/flist.c
        if (!(xflags & XMIT_SAME_MODE))
                mode = from_wire_mode(read_int(f));
  
-@@ -942,6 +967,8 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x
+@@ -946,6 +971,8 @@ static struct file_struct *recv_file_entry(int f, struct file_list *flist, int x
                F_GROUP(file) = gid;
                file->flags |= gid_flags;
        }
@@ -128,7 +129,7 @@ diff --git a/flist.c b/flist.c
        if (unsort_ndx)
                F_NDX(file) = flist->used + flist->ndx_start;
  
-@@ -1320,6 +1347,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1324,6 +1351,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
                F_GROUP(file) = st.st_gid;
        if (am_generator && st.st_uid == our_uid)
                file->flags |= FLAG_OWNED_BY_US;
@@ -156,20 +157,41 @@ diff --git a/generator.c b/generator.c
  extern int preserve_hard_links;
  extern int preserve_executability;
  extern int preserve_fileflags;
-@@ -604,6 +606,13 @@ static inline int ownership_differs(struct file_struct *file, stat_x *sxp)
-       return 0;
+@@ -577,8 +579,15 @@ static void do_delete_pass(void)
+               rprintf(FINFO, "                    \r");
  }
  
+-static inline int time_differs(struct file_struct *file, stat_x *sxp)
++static inline int time_differs(struct file_struct *file, stat_x *sxp, const char *fname)
+ {
 +      if (crtimes_ndx) {
 +              if (sxp->crtime == 0)
 +                      sxp->crtime = get_create_time(fname);
 +              if (cmp_time(sxp->crtime, f_crtime(file)) != 0)
-+                      return 0;
++                      return 1;
 +      }
 +
- #ifdef SUPPORT_ACLS
- static inline int acls_differ(const char *fname, struct file_struct *file, stat_x *sxp)
+       return cmp_time(sxp->st.st_mtime, file->modtime);
+ }
+@@ -636,7 +645,7 @@ int unchanged_attrs(const char *fname, struct file_struct *file, stat_x *sxp)
  {
+       if (S_ISLNK(file->mode)) {
+ #ifdef CAN_SET_SYMLINK_TIMES
+-              if (preserve_times & PRESERVE_LINK_TIMES && time_differs(file, sxp))
++              if (preserve_times & PRESERVE_LINK_TIMES && time_differs(file, sxp, fname))
+                       return 0;
+ #endif
+ #ifdef CAN_CHMOD_SYMLINK
+@@ -656,7 +665,7 @@ int unchanged_attrs(const char *fname, struct file_struct *file, stat_x *sxp)
+                       return 0;
+ #endif
+       } else {
+-              if (preserve_times && time_differs(file, sxp))
++              if (preserve_times && time_differs(file, sxp, fname))
+                       return 0;
+               if (perms_differ(file, sxp))
+                       return 0;
 @@ -699,6 +708,12 @@ void itemize(const char *fnamecmp, struct file_struct *file, int ndx, int statre
                 : iflags & (ITEM_TRANSFER|ITEM_LOCAL_CHANGE) && !(iflags & ITEM_MATCHED)
                  && (!(iflags & ITEM_XNAME_FOLLOWS) || *xname))
@@ -448,7 +470,7 @@ diff --git a/rsync.yo b/rsync.yo
       --super                 receiver attempts super-user activities
       --fake-super            store/recover privileged attrs using xattrs
   -S, --sparse                handle sparse files efficiently
-@@ -1085,6 +1086,9 @@ it is preserving modification times (see bf(--times)).  If NFS is sharing
+@@ -1086,6 +1087,9 @@ it is preserving modification times (see bf(--times)).  If NFS is sharing
  the directories on the receiving side, it is a good idea to use bf(-O).
  This option is inferred if you use bf(--backup) without bf(--backup-dir).
  
@@ -458,7 +480,7 @@ diff --git a/rsync.yo b/rsync.yo
  dit(bf(--super)) This tells the receiving side to attempt super-user
  activities even if the receiving rsync wasn't run by the super-user.  These
  activities include: preserving users via the bf(--owner) option, preserving
-@@ -1785,7 +1789,7 @@ with older versions of rsync, but that also turns on the output of other
+@@ -1782,7 +1786,7 @@ with older versions of rsync, but that also turns on the output of other
  verbose messages).
  
  The "%i" escape has a cryptic output that is 11 letters long.  The general
@@ -467,7 +489,7 @@ diff --git a/rsync.yo b/rsync.yo
  type of update being done, bf(X) is replaced by the file-type, and the
  other letters represent attributes that may be output if they are being
  modified.
-@@ -1844,6 +1848,8 @@ quote(itemization(
+@@ -1841,6 +1845,8 @@ quote(itemization(
    it() The bf(f) means that the fileflags information changed.
    it() The bf(a) means that the ACL information changed.
    it() The bf(x) means that the extended attribute information changed.
@@ -479,12 +501,11 @@ diff --git a/rsync.yo b/rsync.yo
 diff --git a/syscall.c b/syscall.c
 --- a/syscall.c
 +++ b/syscall.c
-@@ -37,6 +37,14 @@ extern int force_change;
+@@ -37,6 +37,13 @@ extern int force_change;
  extern int preserve_perms;
  extern int preserve_executability;
  
-+#pragma pack(push)
-+#pragma pack(4)
++#pragma pack(push, 4)
 +struct create_time {
 +      uint32 length;
 +      struct timespec crtime;
@@ -494,7 +515,7 @@ diff --git a/syscall.c b/syscall.c
  #define RETURN_ERROR_IF(x,e) \
        do { \
                if (x) { \
-@@ -417,6 +425,36 @@ OFF_T do_lseek(int fd, OFF_T offset, int whence)
+@@ -417,6 +424,36 @@ OFF_T do_lseek(int fd, OFF_T offset, int whence)
  #endif
  }
  
@@ -573,9 +594,9 @@ diff --git a/testsuite/rsync.fns b/testsuite/rsync.fns
 +all_plus='++++++++++'
 +allspace='          '
 +dots='......' # trailing dots after changes
+ tab_ch='      ' # a single tab character
  
  # Berkley's nice.
- PATH="$PATH:/usr/ucb"
 diff --git a/tls.c b/tls.c
 --- a/tls.c
 +++ b/tls.c