fixed a race condition in the --delete handling code. The bug led to
authorAndrew Tridgell <tridge@samba.org>
Wed, 27 May 1998 06:30:50 +0000 (06:30 +0000)
committerAndrew Tridgell <tridge@samba.org>
Wed, 27 May 1998 06:30:50 +0000 (06:30 +0000)
spurious error messages about not be able to delete some files.

this fix also makes --delete processing more efficient

flist.c
rsync.c
rsync.h

diff --git a/flist.c b/flist.c
index a185082..5cf3044 100644 (file)
--- 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 2f772ac..1621995 100644 (file)
--- 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 7e2967b..877ce04 100644 (file)
--- 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