diff options
author | Wayne Davison <wayned@samba.org> | 2008-08-02 09:14:36 -0700 |
---|---|---|
committer | Wayne Davison <wayned@samba.org> | 2008-08-02 09:14:36 -0700 |
commit | f303b749f2843433c9acd8218a4b9096d0d1bb8d (patch) | |
tree | 7804d3e63bc5e1a590b916666cc6affc11aad6c4 /rsync.c | |
parent | 91fd15b8b654a3be886069510d85064d59ca5dc7 (diff) | |
download | rsync-f303b749f2843433c9acd8218a4b9096d0d1bb8d.tar.gz rsync-f303b749f2843433c9acd8218a4b9096d0d1bb8d.tar.bz2 rsync-f303b749f2843433c9acd8218a4b9096d0d1bb8d.zip |
Added logic to the receiving side to ensure that the --delete-during
code will not delete in a directory prior to receiving an I/O error
for that directory (or not receiving it, as the case may be).
Diffstat (limited to 'rsync.c')
-rw-r--r-- | rsync.c | 15 |
1 files changed, 14 insertions, 1 deletions
@@ -48,6 +48,8 @@ extern int flist_eof; extern int msgs2stderr; extern int keep_dirlinks; extern int make_backups; +extern int delete_during; +extern int check_for_io_err; extern struct file_list *cur_flist, *first_flist, *dir_flist; extern struct chmod_mode_struct *daemon_chmod_modes; #ifdef ICONV_OPTION @@ -252,8 +254,15 @@ int read_ndx_and_attrs(int f_in, int *iflag_ptr, uchar *type_ptr, while (1) { ndx = read_ndx(f_in); - if (ndx >= 0) + if (ndx >= 0) { + if (check_for_io_err) { + /* Let generator know there was no I/O error. */ + send_msg_int(MSG_IO_ERROR, 0); + check_for_io_err = 0; + } break; + } + check_for_io_err = 0; if (ndx == NDX_DONE) return ndx; if (!inc_recurse || am_sender) @@ -287,6 +296,10 @@ int read_ndx_and_attrs(int f_in, int *iflag_ptr, uchar *type_ptr, stop_flist_forward(); if (!msgs2stderr) negate_output_levels(); /* restore info/debug output */ + /* If the sender is going to send us an MSG_IO_ERROR value, it + * will always be the very next message following a file list. */ + if (delete_during) + check_for_io_err = 1; } iflags = protocol_version >= 29 ? read_shortint(f_in) |