--- embedaddon/rsync/cleanup.c 2013/10/14 07:51:14 1.1.1.2 +++ embedaddon/rsync/cleanup.c 2016/11/01 09:54:32 1.1.1.3 @@ -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-2015 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; @@ -156,8 +157,6 @@ NORETURN void _exit_cleanup(int code, const char *file switch_step++; if (cleanup_got_literal && (cleanup_fname || cleanup_fd_w != -1)) { - const char *fname = cleanup_fname; - cleanup_fname = NULL; if (cleanup_fd_r != -1) { close(cleanup_fd_r); cleanup_fd_r = -1; @@ -167,9 +166,11 @@ NORETURN void _exit_cleanup(int code, const char *file close(cleanup_fd_w); cleanup_fd_w = -1; } - if (fname && cleanup_new_fname && keep_partial + if (cleanup_fname && cleanup_new_fname && keep_partial && handle_partial_dir(cleanup_new_fname, PDIR_CREATE)) { int tweak_modtime = 0; + 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 @@ -232,8 +233,9 @@ NORETURN void _exit_cleanup(int code, const char *file 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 */