Moved the verbose message about renaming the finished file down into
authorWayne Davison <wayned@samba.org>
Fri, 2 Jul 2004 18:13:53 +0000 (18:13 +0000)
committerWayne Davison <wayned@samba.org>
Fri, 2 Jul 2004 18:13:53 +0000 (18:13 +0000)
finish_transfer() so that it only gets output when we're actually going
to rename the file.

receiver.c
rsync.c

index 29fd33c2b7fd0282a9ad1448a8cfc25e41a42c50..0aeda10908d30b34f54feef421a8080bc9f407a3 100644 (file)
@@ -474,9 +474,6 @@ int recv_files(int f_in,struct file_list *flist,char *local_name)
                        exit_cleanup(RERR_FILEIO);
                }
 
-               if (verbose > 2)
-                       rprintf(FINFO,"renaming %s to %s\n",fnametmp,fname);
-
                if (recv_ok || keep_partial)
                        finish_transfer(fname, fnametmp, file, recv_ok);
                else
diff --git a/rsync.c b/rsync.c
index ffe8ed9eaf884ff5c856f83a542e83669d64de13..125369bc84f6cc3d08308b6da179d930f9a08372 100644 (file)
--- a/rsync.c
+++ b/rsync.c
@@ -240,6 +240,8 @@ void finish_transfer(char *fname, char *fnametmp, struct file_struct *file,
                return;
 
        /* move tmp file over real file */
+       if (verbose > 2)
+               rprintf(FINFO, "renaming %s to %s\n", fnametmp, fname);
        ret = robust_rename(fnametmp, fname, file->mode & INITACCESSPERMS);
        if (ret < 0) {
                rsyserr(FERROR, errno, "%s %s -> \"%s\"",