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 7a1c3f93e96febbbcb6cc2eed71bb2acbbac430c..472e1ef2e7880fc1de46da6b6a903907dbc113e5 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)