Honor the new omit_dir_times var.
authorWayne Davison <wayned@samba.org>
Mon, 24 Jan 2005 00:51:34 +0000 (00:51 +0000)
committerWayne Davison <wayned@samba.org>
Mon, 24 Jan 2005 00:51:34 +0000 (00:51 +0000)
rsync.c

diff --git a/rsync.c b/rsync.c
index 25775a6545f0ddf1f4872eb22ba72ecbcb1e8853..576ce63f7ca8f1198e790a38b5a4ff415b1108c0 100644 (file)
--- a/rsync.c
+++ b/rsync.c
@@ -25,6 +25,7 @@
 extern int verbose;
 extern int dry_run;
 extern int preserve_times;
+extern int omit_dir_times;
 extern int am_root;
 extern int am_sender;
 extern int am_generator;
@@ -165,14 +166,12 @@ int set_perms(char *fname,struct file_struct *file,STRUCT_STAT *st,
        }
 
        if (!preserve_times || S_ISLNK(st->st_mode)
-           || (make_backups && !backup_dir && S_ISDIR(st->st_mode)))
+        || (S_ISDIR(st->st_mode)
+         && (omit_dir_times || (make_backups && !backup_dir))))
                flags |= PERMS_SKIP_MTIME;
        if (!(flags & PERMS_SKIP_MTIME)
            && cmp_modtime(st->st_mtime, file->modtime) != 0) {
-               /* don't complain about not setting times on directories
-                * because some filesystems can't do it */
-               if (set_modtime(fname,file->modtime) != 0 &&
-                   !S_ISDIR(st->st_mode)) {
+               if (set_modtime(fname,file->modtime) != 0) {
                        rsyserr(FERROR, errno, "failed to set times on %s",
                                full_fname(fname));
                        return 0;