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 29fd33c..0aeda10 100644 (file)
@@ -474,9 +474,6 @@ int recv_files(int f_in,struct file_list *flist,char *local_name)
                        exit_cleanup(RERR_FILEIO);
                }
 
                        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
                if (recv_ok || keep_partial)
                        finish_transfer(fname, fnametmp, file, recv_ok);
                else
diff --git a/rsync.c b/rsync.c
index ffe8ed9..125369b 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 */
                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\"",
        ret = robust_rename(fnametmp, fname, file->mode & INITACCESSPERMS);
        if (ret < 0) {
                rsyserr(FERROR, errno, "%s %s -> \"%s\"",