diff options
author | Andrew Tridgell <tridge@samba.org> | 1998-09-09 06:23:27 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 1998-09-09 06:23:27 +0000 |
commit | c6b81a9865b49f39f7d388ac64a8d74ce414081e (patch) | |
tree | 19884acaa0b9ff3be2bec548ef3a33e571b96b96 /cleanup.c | |
parent | e0414f42027769676cfd0a119eab2fa8e62f8e0f (diff) | |
download | rsync-c6b81a9865b49f39f7d388ac64a8d74ce414081e.tar.gz |
handle OSes where you can't rename a open file in the cleanup code.
Diffstat (limited to 'cleanup.c')
-rw-r--r-- | cleanup.c | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -27,6 +27,8 @@ int cleanup_got_literal=0; static char *cleanup_fname; static char *cleanup_new_fname; static struct file_struct *cleanup_file; +static int cleanup_fd1, cleanup_fd2; +static struct map_struct *cleanup_buf; void exit_cleanup(int code) { @@ -37,6 +39,9 @@ void exit_cleanup(int code) if (cleanup_got_literal && cleanup_fname && keep_partial) { char *fname = cleanup_fname; cleanup_fname = NULL; + if (cleanup_buf) unmap_file(cleanup_buf); + if (cleanup_fd1 != -1) close(cleanup_fd1); + if (cleanup_fd2 != -1) close(cleanup_fd2); finish_transfer(cleanup_new_fname, fname, cleanup_file); } io_flush(); @@ -55,9 +60,13 @@ void cleanup_disable(void) } -void cleanup_set(char *fnametmp, char *fname, struct file_struct *file) +void cleanup_set(char *fnametmp, char *fname, struct file_struct *file, + struct map_struct *buf, int fd1, int fd2) { cleanup_fname = fnametmp; cleanup_new_fname = fname; cleanup_file = file; + cleanup_buf = buf; + cleanup_fd1 = fd1; + cleanup_fd2 = fd2; } |