summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2000-01-24 09:13:39 +0000
committerAndrew Tridgell <tridge@samba.org>2000-01-24 09:13:39 +0000
commit1d2c275fffcde1fb0e53f736b282117883f84d2c (patch)
tree3d8e2414a5f9c57523771038d387e8615e45bdb1
parentd0fd26aa168610ae625cce72226e27e6134c678f (diff)
downloadrsync-1d2c275fffcde1fb0e53f736b282117883f84d2c.tar.gz
I can't believe it - solaris allows unlink of a non-empty directory as
root, leaving a corrupt filesystem. Are those guys on drugs? try to avoid the problem as best we can.
-rw-r--r--rsync.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/rsync.c b/rsync.c
index 039e1cd5..ce8e9018 100644
--- a/rsync.c
+++ b/rsync.c
@@ -56,8 +56,6 @@ int delete_file(char *fname)
int ret;
extern int recurse;
- if (robust_unlink(fname) == 0 || errno == ENOENT) return 0;
-
#if SUPPORT_LINKS
ret = do_lstat(fname, &st);
#else
@@ -69,6 +67,7 @@ int delete_file(char *fname)
}
if (!S_ISDIR(st.st_mode)) {
+ if (robust_unlink(fname) == 0 || errno == ENOENT) return 0;
rprintf(FERROR,"unlink(%s) : %s\n", fname, strerror(errno));
return -1;
}