Add safety check for local --remove-source-files.
[rsync.git] / cleanup.c
index b477e6603b2a24a8197bdea06d476539a1685351..40d26baa8f8f79b2bb6b330910036169acb3314f 100644 (file)
--- a/cleanup.c
+++ b/cleanup.c
@@ -137,7 +137,7 @@ NORETURN void _exit_cleanup(int code, const char *file, int line)
                if (DEBUG_GTE(EXIT, 2)) {
                        rprintf(FINFO,
                                "[%s] _exit_cleanup(code=%d, file=%s, line=%d): entered\n",
-                               who_am_i(), code, file, line);
+                               who_am_i(), code, src_file(file), line);
                }
 
 #include "case_N.h"
@@ -172,11 +172,11 @@ NORETURN void _exit_cleanup(int code, const char *file, int line)
                                const char *fname = cleanup_fname;
                                cleanup_fname = NULL;
                                if (!partial_dir) {
-                                   /* We don't want to leave a partial file with a modern time or it
-                                    * could be skipped via --update.  Setting the time to something
-                                    * really old also helps it to stand out as unfinished in an ls. */
-                                   tweak_modtime = 1;
-                                   cleanup_file->modtime = 0;
+                                       /* We don't want to leave a partial file with a modern time or it
+                                        * could be skipped via --update.  Setting the time to something
+                                        * really old also helps it to stand out as unfinished in an ls. */
+                                       tweak_modtime = 1;
+                                       cleanup_file->modtime = 0;
                                }
                                finish_transfer(cleanup_new_fname, fname, NULL, NULL,
                                                cleanup_file, tweak_modtime, !partial_dir);
@@ -221,8 +221,9 @@ NORETURN void _exit_cleanup(int code, const char *file, int line)
                /* If line < 0, this exit is after a MSG_ERROR_EXIT event, so
                 * we don't want to output a duplicate error. */
                if ((exit_code && line > 0)
-                || am_daemon || (logfile_name && (am_server || !INFO_GTE(STATS, 1))))
+                || am_daemon || (logfile_name && (am_server || !INFO_GTE(STATS, 1)))) {
                        log_exit(exit_code, exit_file, exit_line);
+               }
 
 #include "case_N.h"
                switch_step++;