Matt McCutchen's Web Site
/
rsync
/
rsync.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
528bfcd
)
don't do recursive deletion if the recurse option is not selected.
author
Andrew Tridgell
<tridge@samba.org>
Thu, 28 May 1998 05:05:26 +0000
(
05:05
+0000)
committer
Andrew Tridgell
<tridge@samba.org>
Thu, 28 May 1998 05:05:26 +0000
(
05:05
+0000)
rsync.c
patch
|
blob
|
blame
|
history
diff --git
a/rsync.c
b/rsync.c
index
555c009
..
f41029b
100644
(file)
--- a/
rsync.c
+++ b/
rsync.c
@@
-74,6
+74,7
@@
static int delete_file(char *fname)
extern int force_delete;
STRUCT_STAT st;
int ret;
+ extern int recurse;
if (do_unlink(fname) == 0 || errno == ENOENT) return 0;
@@
-93,7
+94,8
@@
static int delete_file(char *fname)
}
if (do_rmdir(fname) == 0 || errno == ENOENT) return 0;
- if (!force_delete || (errno != ENOTEMPTY && errno != EEXIST)) {
+ if (!force_delete || !recurse ||
+ (errno != ENOTEMPTY && errno != EEXIST)) {
rprintf(FERROR,"rmdir(%s) : %s\n", fname, strerror(errno));
return -1;
}