]> git.ipfire.org Git - thirdparty/rsync.git/commitdiff
Made delete_one() handle a failed rmdir on a symlink when
authorWayne Davison <wayned@samba.org>
Fri, 11 Jun 2004 07:40:48 +0000 (07:40 +0000)
committerWayne Davison <wayned@samba.org>
Fri, 11 Jun 2004 07:40:48 +0000 (07:40 +0000)
--keep-dirlinks was specified.

receiver.c

index 5d19148232d0a50fc5f04baa03766f343d3b27c8..f39a9e56081936f29157510f3ee387b1d397b6a3 100644 (file)
@@ -30,6 +30,7 @@ extern struct stats stats;
 extern int dry_run;
 extern int am_server;
 extern int relative_paths;
+extern int keep_dirlinks;
 extern int preserve_hard_links;
 extern int preserve_perms;
 extern int cvs_exclude;
@@ -59,6 +60,8 @@ static void delete_one(char *fn, int is_dir)
                }
        } else {
                if (do_rmdir(fn) != 0) {
+                       if (errno == ENOTDIR && keep_dirlinks)
+                               return delete_one(fn, 0);
                        if (errno != ENOTEMPTY && errno != EEXIST) {
                                rsyserr(FERROR, errno,
                                        "delete_one: rmdir %s failed",