diff options
author | Wayne Davison <wayned@samba.org> | 2014-01-19 14:35:05 -0800 |
---|---|---|
committer | Wayne Davison <wayned@samba.org> | 2014-01-19 14:35:05 -0800 |
commit | a106ed78d57f901ccfdf5145923f8c2bf6b33ef8 (patch) | |
tree | 15d116216f629a0fa12f1eb7307d22d36ffd8d1c | |
parent | bba31ddf122c18ec88fe26a30c5ab9844d41ace7 (diff) | |
download | rsync-a106ed78d57f901ccfdf5145923f8c2bf6b33ef8.tar.gz rsync-a106ed78d57f901ccfdf5145923f8c2bf6b33ef8.tar.bz2 rsync-a106ed78d57f901ccfdf5145923f8c2bf6b33ef8.zip |
Fix the leaving of a temp file w/o partial-file saving.
Fixed bug 10350.
-rw-r--r-- | cleanup.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -156,8 +156,6 @@ NORETURN void _exit_cleanup(int code, const char *file, int line) 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 +165,11 @@ NORETURN void _exit_cleanup(int code, const char *file, int line) 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 |