The inplace handling in finish_transfer() now passes PERMS_SKIP_MTIME
authorWayne Davison <wayned@samba.org>
Thu, 22 Jul 2004 15:30:04 +0000 (15:30 +0000)
committerWayne Davison <wayned@samba.org>
Thu, 22 Jul 2004 15:30:04 +0000 (15:30 +0000)
to set_perms() if ok_to_set_time wasn't specified.

rsync.c

diff --git a/rsync.c b/rsync.c
index 7a1c3f9..472e1ef 100644 (file)
--- a/rsync.c
+++ b/rsync.c
@@ -243,8 +243,7 @@ void finish_transfer(char *fname, char *fnametmp, struct file_struct *file,
        if (inplace) {
                if (verbose > 2)
                        rprintf(FINFO, "finishing %s\n", fname);
-               set_perms(fname, file, NULL, 0);
-               return;
+               goto do_set_perms;
        }
 
        /* move tmp file over real file */
@@ -256,10 +255,10 @@ void finish_transfer(char *fname, char *fnametmp, struct file_struct *file,
                    ret == -2 ? "copy" : "rename",
                    full_fname(fnametmp), fname);
                do_unlink(fnametmp);
-       } else {
-               set_perms(fname, file, NULL,
-                         ok_to_set_time ? 0 : PERMS_SKIP_MTIME);
+               return;
        }
+    do_set_perms:
+       set_perms(fname, file, NULL, ok_to_set_time ? 0 : PERMS_SKIP_MTIME);
 }
 
 const char *who_am_i(void)