diff options
author | Andrew Tridgell <tridge@samba.org> | 1998-05-27 06:30:50 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 1998-05-27 06:30:50 +0000 |
commit | 7b1ce0d746df0d7f7f33238799949ff3cec911a2 (patch) | |
tree | d54d019a5979ca8e905b3cde15a01ffc40fec1cf | |
parent | 54816348d163e63cf696434d8d0c8dd20da3641b (diff) | |
download | rsync-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.c | 2 | ||||
-rw-r--r-- | rsync.c | 6 | ||||
-rw-r--r-- | rsync.h | 2 |
3 files changed, 6 insertions, 4 deletions
@@ -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); @@ -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]); @@ -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 |