summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1998-05-27 06:30:50 +0000
committerAndrew Tridgell <tridge@samba.org>1998-05-27 06:30:50 +0000
commit7b1ce0d746df0d7f7f33238799949ff3cec911a2 (patch)
treed54d019a5979ca8e905b3cde15a01ffc40fec1cf
parent54816348d163e63cf696434d8d0c8dd20da3641b (diff)
downloadrsync-7b1ce0d746df0d7f7f33238799949ff3cec911a2.tar.gz
rsync-7b1ce0d746df0d7f7f33238799949ff3cec911a2.tar.bz2
rsync-7b1ce0d746df0d7f7f33238799949ff3cec911a2.zip
fixed a race condition in the --delete handling code. The bug led to
spurious error messages about not be able to delete some files. this fix also makes --delete processing more efficient
-rw-r--r--flist.c2
-rw-r--r--rsync.c6
-rw-r--r--rsync.h2
3 files changed, 6 insertions, 4 deletions
diff --git a/flist.c b/flist.c
index a185082b..5cf30446 100644
--- a/flist.c
+++ b/flist.c
@@ -548,7 +548,7 @@ static void send_directory(int f,struct file_list *flist,char *dir)
strcmp(dname,"..")==0)
continue;
strlcpy(p,dname,MAXPATHLEN-(l+1));
- send_file_name(f,flist,fname,recurse,FLAG_DELETE);
+ send_file_name(f,flist,fname,recurse,0);
}
closedir(d);
diff --git a/rsync.c b/rsync.c
index 2f772ace..1621995b 100644
--- a/rsync.c
+++ b/rsync.c
@@ -696,7 +696,8 @@ static void delete_files(struct file_list *flist)
if (!S_ISDIR(flist->files[j]->mode) ||
!(flist->files[j]->flags & FLAG_DELETE)) continue;
- if (delete_already_done(flist, j)) continue;
+ if (remote_version < 19 &&
+ delete_already_done(flist, j)) continue;
name = strdup(f_name(flist->files[j]));
@@ -710,7 +711,8 @@ static void delete_files(struct file_list *flist)
for (i=local_file_list->count-1;i>=0;i--) {
if (!local_file_list->files[i]->basename) continue;
- if (S_ISDIR(local_file_list->files[i]->mode))
+ if (remote_version < 19 &&
+ S_ISDIR(local_file_list->files[i]->mode))
add_delete_entry(local_file_list->files[i]);
if (-1 == flist_find(flist,local_file_list->files[i])) {
delete_one(local_file_list->files[i]);
diff --git a/rsync.h b/rsync.h
index 7e2967b7..877ce049 100644
--- a/rsync.h
+++ b/rsync.h
@@ -41,7 +41,7 @@
#define SAME_TIME (1<<7)
/* update this if you make incompatible changes */
-#define PROTOCOL_VERSION 18
+#define PROTOCOL_VERSION 19
#define MIN_PROTOCOL_VERSION 11
#define MAX_PROTOCOL_VERSION 30