Fix --remove-source-files sanity check w/--copy-links the right way.
[rsync.git] / cleanup.c
index 961c1d264d1fb04179e310db4ca281956fbb9da2..c3ae799925b2531373bf03cc3ca76c853c40a563 100644 (file)
--- a/cleanup.c
+++ b/cleanup.c
@@ -4,7 +4,7 @@
  * Copyright (C) 1996-2000 Andrew Tridgell
  * Copyright (C) 1996 Paul Mackerras
  * Copyright (C) 2002 Martin Pool
- * Copyright (C) 2003-2013 Wayne Davison
+ * Copyright (C) 2003-2018 Wayne Davison
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -22,6 +22,7 @@
 
 #include "rsync.h"
 
+extern int dry_run;
 extern int am_server;
 extern int am_daemon;
 extern int am_receiver;
@@ -137,7 +138,6 @@ NORETURN void _exit_cleanup(int code, const char *file, int line)
                                who_am_i(), code, file, line);
                }
 
-               /* FALLTHROUGH */
 #include "case_N.h"
                switch_step++;
 
@@ -151,7 +151,6 @@ NORETURN void _exit_cleanup(int code, const char *file, int line)
                        }
                }
 
-               /* FALLTHROUGH */
 #include "case_N.h"
                switch_step++;
 
@@ -182,7 +181,6 @@ NORETURN void _exit_cleanup(int code, const char *file, int line)
                        }
                }
 
-               /* FALLTHROUGH */
 #include "case_N.h"
                switch_step++;
 
@@ -194,7 +192,6 @@ NORETURN void _exit_cleanup(int code, const char *file, int line)
                if (!exit_code && !code)
                        io_flush(FULL_FLUSH);
 
-               /* FALLTHROUGH */
 #include "case_N.h"
                switch_step++;
 
@@ -225,18 +222,17 @@ NORETURN void _exit_cleanup(int code, const char *file, int line)
                 || am_daemon || (logfile_name && (am_server || !INFO_GTE(STATS, 1))))
                        log_exit(exit_code, exit_file, exit_line);
 
-               /* FALLTHROUGH */
 #include "case_N.h"
                switch_step++;
 
                if (DEBUG_GTE(EXIT, 1)) {
                        rprintf(FINFO,
                                "[%s] _exit_cleanup(code=%d, file=%s, line=%d): "
-                               "about to call exit(%d)\n",
-                               who_am_i(), first_code, exit_file, exit_line, exit_code);
+                               "about to call exit(%d)%s\n",
+                               who_am_i(), first_code, exit_file, exit_line, exit_code,
+                               dry_run ? " (DRY RUN)" : "");
                }
 
-               /* FALLTHROUGH */
 #include "case_N.h"
                switch_step++;
 
@@ -252,7 +248,6 @@ NORETURN void _exit_cleanup(int code, const char *file, int line)
                        noop_io_until_death();
                }
 
-               /* FALLTHROUGH */
 #include "case_N.h"
                switch_step++;