Possible bug - delete complains about parent directory in new version

Wayne Davison wayned at samba.org
Wed May 18 23:56:46 GMT 2005


On Wed, May 18, 2005 at 04:30:58PM -0400, Lloyd J. McDonald wrote:
>    rsync: delete_file: rmdir "dir/pdf" failed: File exists (17)

On my OS, rmdir() returns ENOTEMPTY in this case, so my testing didn't
reveal that one of two places in the improved delete code failed to
check for an EEXIST errno.  Attached is the fix.  Feel free to try it
out on 2.5.6pre1, if you like (2.5.6 is a bug-fix release, so pre1 is
a very safe pre-release).

Thanks for the report (and the excellent explanation)!

..wayne..
-------------- next part --------------
--- generator.c	13 May 2005 23:00:20 -0000	1.210
+++ generator.c	18 May 2005 23:51:03 -0000
@@ -186,7 +186,7 @@ static int delete_item(char *fname, int 
 	if (do_rmdir(fname) == 0) {
 		if (!(flags & DEL_TERSE))
 			log_delete(fname, mode);
-	} else if (errno != ENOTEMPTY && errno != ENOENT) {
+	} else if (errno != ENOTEMPTY && errno != EEXIST && errno != ENOENT) {
 		rsyserr(FERROR, errno, "delete_file: rmdir %s failed",
 			full_fname(fname));
 		return -1;


More information about the rsync mailing list