fixed a race condition in the --delete handling code. The bug led to
[rsync/rsync.git] / rsync.c
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]);