diff options
author | Andrew Tridgell <tridge@samba.org> | 1998-05-28 05:05:26 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 1998-05-28 05:05:26 +0000 |
commit | 05848a2cc797b777473023b0dff6bba62668dc78 (patch) | |
tree | 48416045b6c1065c25cb2c75dda8f914a80b8883 /rsync.c | |
parent | 528bfcd79a0ebcf9a2a0071981525213f25b1fc6 (diff) | |
download | rsync-05848a2cc797b777473023b0dff6bba62668dc78.tar.gz rsync-05848a2cc797b777473023b0dff6bba62668dc78.tar.bz2 rsync-05848a2cc797b777473023b0dff6bba62668dc78.zip |
don't do recursive deletion if the recurse option is not selected.
Diffstat (limited to 'rsync.c')
-rw-r--r-- | rsync.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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; } |