Fix the time-setting section in set_perms() so that it only skips the
authorWayne Davison <wayned@samba.org>
Fri, 13 Aug 2004 08:23:06 +0000 (08:23 +0000)
committerWayne Davison <wayned@samba.org>
Fri, 13 Aug 2004 08:23:06 +0000 (08:23 +0000)
call to set_times() if both PERMS_SKIP_ATIME and PERMS_SKIP_MTIME are
set.

atimes.diff

index 1ab0c6d..c6ae783 100644 (file)
@@ -15,7 +15,7 @@ command before "make":
                rprintf(FINFO, "flist->length=%.0f\n",
                        (double) fptr[i]->length);
                rprintf(FINFO, "flist->mode=%#o\n", (int) fptr[i]->mode);
---- orig/flist.c       2004-08-11 23:42:23
+--- orig/flist.c       2004-08-12 18:34:38
 +++ flist.c    2004-07-03 20:15:41
 @@ -58,6 +58,7 @@ extern int relative_paths;
  extern int implied_dirs;
@@ -148,7 +148,7 @@ command before "make":
                if (verbose > 1)
                        rprintf(FINFO, "%s is newer\n", safe_fname(fname));
                return;
---- orig/options.c     2004-08-11 23:42:23
+--- orig/options.c     2004-08-12 18:34:38
 +++ options.c  2004-07-03 20:15:41
 @@ -48,6 +48,7 @@ int preserve_devices = 0;
  int preserve_uid = 0;
@@ -184,7 +184,7 @@ command before "make":
                argstr[x++] = 'p';
        if (recurse)
 --- orig/rsync.c       2004-08-09 21:07:10
-+++ rsync.c    2004-07-03 20:15:41
++++ rsync.c    2004-08-13 08:17:28
 @@ -25,6 +25,7 @@
  extern int verbose;
  extern int dry_run;
@@ -193,7 +193,7 @@ command before "make":
  extern int am_root;
  extern int am_sender;
  extern int am_generator;
-@@ -145,17 +146,31 @@ int set_perms(char *fname,struct file_st
+@@ -145,17 +146,32 @@ int set_perms(char *fname,struct file_st
        if (!preserve_times || S_ISLNK(st->st_mode)
            || (make_backups && !backup_dir && S_ISDIR(st->st_mode)))
                flags |= PERMS_SKIP_MTIME;
@@ -201,7 +201,8 @@ command before "make":
 -          && cmp_modtime(st->st_mtime, file->modtime) != 0) {
 +      if (!copy_atimes || S_ISLNK(st->st_mode) || S_ISDIR(st->st_mode))
 +              flags |= PERMS_SKIP_ATIME;
-+      if (!(flags & (PERMS_SKIP_MTIME|PERMS_SKIP_ATIME))) {
++      if ((flags & (PERMS_SKIP_MTIME|PERMS_SKIP_ATIME))
++          != (PERMS_SKIP_MTIME|PERMS_SKIP_ATIME)) {
 +              time_t atime, mtime;
 +
 +              if (!(flags & PERMS_SKIP_ATIME)
@@ -255,9 +256,9 @@ command before "make":
        uid_t uid;
        gid_t gid;
        mode_t mode;
---- orig/rsync.yo      2004-08-11 17:26:27
+--- orig/rsync.yo      2004-08-13 07:18:59
 +++ rsync.yo   2004-07-03 20:15:41
-@@ -301,6 +301,7 @@ verb(
+@@ -330,6 +330,7 @@ verb(
   -g, --group                 preserve group
   -D, --devices               preserve devices (root only)
   -t, --times                 preserve times
@@ -265,7 +266,7 @@ command before "make":
   -S, --sparse                handle sparse files efficiently
   -n, --dry-run               show what would have been transferred
   -W, --whole-file            copy whole files, no incremental checks
-@@ -574,6 +575,11 @@ cause the next transfer to behave as if 
+@@ -603,6 +604,11 @@ cause the next transfer to behave as if 
  updated (though the rsync algorithm will make the update fairly efficient
  if the files haven't actually changed, you're much better off using -t).
  
@@ -482,7 +483,7 @@ command before "make":
  
        return 0;
  }
---- orig/util.c        2004-08-11 23:42:23
+--- orig/util.c        2004-08-13 07:18:59
 +++ util.c     2004-07-03 20:15:41
 @@ -128,31 +128,39 @@ void overflow(char *str)
  
@@ -530,7 +531,7 @@ command before "make":
                t[0].tv_usec = 0;
                t[1].tv_sec = modtime;
                t[1].tv_usec = 0;
-@@ -1156,8 +1164,8 @@ int msleep(int t)
+@@ -1142,8 +1150,8 @@ int msleep(int t)
  
  
  /**
@@ -541,7 +542,7 @@ command before "make":
   * --modify-window).
   *
   * @retval 0 if the times should be treated as the same
-@@ -1166,7 +1174,7 @@ int msleep(int t)
+@@ -1152,7 +1160,7 @@ int msleep(int t)
   *
   * @retval -1 if the 2nd is later
   **/