summaryrefslogtreecommitdiff
path: root/cleanup.c
diff options
context:
space:
mode:
authorWayne Davison <wayned@samba.org>2004-10-10 20:31:54 +0000
committerWayne Davison <wayned@samba.org>2004-10-10 20:31:54 +0000
commit09e2bbce8a300a65d34d8f74dffbaa34de1955c7 (patch)
tree4fb2995fdffd6cc99d7bcbcc8b411cd1aee408dc /cleanup.c
parent73496a36a1907112da0415005462fa0bb11d5500 (diff)
downloadrsync-09e2bbce8a300a65d34d8f74dffbaa34de1955c7.tar.gz
rsync-09e2bbce8a300a65d34d8f74dffbaa34de1955c7.tar.bz2
rsync-09e2bbce8a300a65d34d8f74dffbaa34de1955c7.zip
Call flush_write_file() in _exit_cleanup() if we are keeping a
partially-received file.
Diffstat (limited to 'cleanup.c')
-rw-r--r--cleanup.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/cleanup.c b/cleanup.c
index 909e3435..551e4385 100644
--- a/cleanup.c
+++ b/cleanup.c
@@ -117,8 +117,10 @@ void _exit_cleanup(int code, const char *file, int line)
cleanup_fname = NULL;
if (cleanup_fd_r != -1)
close(cleanup_fd_r);
- if (cleanup_fd_w != -1)
+ if (cleanup_fd_w != -1) {
+ flush_write_file(cleanup_fd_w);
close(cleanup_fd_w);
+ }
finish_transfer(cleanup_new_fname, fname, cleanup_file, 0);
}
io_flush(FULL_FLUSH);