On Mon, Dec 22, 2008 at 09:46:40AM +0100, Michal Soltys wrote:
> but ... the dir is not there anymore, thus ENOENT
> (due to opendir failing) and rsync's exit code 23.
Yeah, rsync always generates an error if the opendir() call fails in
send_directory(). The attached patch makes it treat a missing directory
as an empty directory should the opendir() fail with ENOENT. This seems
like an acceptable way to handle the situation even on the sending side:
since the directory is already included in the file list, we don't have
a way to drop it, but treating it as empty (now that the contents of the
directory is gone) seems like it would be safe.
..wayne..
--- a/flist.c
+++ b/flist.c
@@ -1597,6 +1597,8 @@ static void send_directory(int f, struct file_list *flist, char *fbuf, int len,
assert(flist != NULL);
if (!(d = opendir(fbuf))) {
+ if (errno == ENOENT)
+ return;
io_error |= IOERR_GENERAL;
rsyserr(FERROR_XFER, errno, "opendir %s failed", full_fname(fbuf));
return;
--
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html