summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWayne Davison <wayned@samba.org>2014-01-19 14:35:05 -0800
committerWayne Davison <wayned@samba.org>2014-01-19 14:35:05 -0800
commita106ed78d57f901ccfdf5145923f8c2bf6b33ef8 (patch)
tree15d116216f629a0fa12f1eb7307d22d36ffd8d1c
parentbba31ddf122c18ec88fe26a30c5ab9844d41ace7 (diff)
downloadrsync-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.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/cleanup.c b/cleanup.c
index c750ba65..961c1d26 100644
--- a/cleanup.c
+++ b/cleanup.c
@@ -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