Fixed a couple compilation problems, and changed the compatibilty
authorWayne Davison <wayned@samba.org>
Mon, 12 Mar 2007 05:08:18 +0000 (05:08 +0000)
committerWayne Davison <wayned@samba.org>
Mon, 12 Mar 2007 05:08:18 +0000 (05:08 +0000)
code to turn off inc_recurse when --detect-renamed is used.

detect-renamed.diff

index 57659de..278b0d0 100644 (file)
@@ -32,6 +32,26 @@ TODO:
   a file that can't use it, while missing out on giving it to a file
   that could use it.
 
+--- old/compat.c
++++ new/compat.c
+@@ -46,6 +46,7 @@ extern int preserve_hard_links;
+ extern int need_messages_from_generator;
+ extern int delete_mode, delete_before, delete_during, delete_after;
+ extern int delete_excluded;
++extern int detect_renamed;
+ extern int make_backups;
+ extern char *backup_dir, *backup_suffix;
+ extern char *partial_dir;
+@@ -161,7 +162,8 @@ void setup_protocol(int f_out,int f_in)
+               }
+       } else if (protocol_version >= 30) {
+               if (recurse && !preserve_hard_links && !delete_before
+-               && !delete_after && !delay_updates && !prune_empty_dirs)
++               && !delete_after && !delay_updates && !prune_empty_dirs
++               && !detect_renamed)
+                       inc_recurse = 1;
+               need_messages_from_generator = 1;
+       }
 --- old/flist.c
 +++ new/flist.c
 @@ -57,6 +57,7 @@ extern int non_perishable_cnt;
@@ -97,7 +117,7 @@ TODO:
  static void send_directory(int f, struct file_list *flist, int ndx,
                           char *fbuf, int len, int flags);
  
-@@ -1744,6 +1786,25 @@ struct file_list *recv_file_list(int f)
+@@ -1765,6 +1807,25 @@ struct file_list *recv_file_list(int f)
  
        clean_flist(flist, relative_paths, 1);
  
@@ -185,14 +205,14 @@ TODO:
 +                      continue;
 +              }
 +              if (always_checksum) {
-+                      /* We use the FLAG_SENT flag to indicate when we
++                      /* We use the FLAG_FILE_SENT flag to indicate when we
 +                       * have computed the checksum for an entry. */
-+                      if (!(f->flags & FLAG_SENT)) {
++                      if (!(f->flags & FLAG_FILE_SENT)) {
 +                              if (fmid->modtime == f->modtime
 +                               && f_name_cmp(fmid, f) == 0)
 +                                      return -1; /* assume we can't help */
 +                              file_checksum(fname, (char*)F_SUM(f), F_LENGTH(f));
-+                              f->flags |= FLAG_SENT;
++                              f->flags |= FLAG_FILE_SENT;
 +                      }
 +                      diff = u_memcmp(F_SUM(fmid), F_SUM(f), checksum_len);
 +                      if (diff) {
@@ -467,7 +487,7 @@ TODO:
                rprintf(FINFO, "generator starting pid=%ld\n", (long)getpid());
  
 +      if (detect_renamed) {
-+              delayed_bits = bitbag_create(flist->count);
++              delayed_bits = bitbag_create(cur_flist->count);
 +              if (!delete_before && !delete_during)
 +                      delete_during = -1;
 +      }
@@ -505,7 +525,7 @@ TODO:
 +              detect_renamed = 0;
 +
 +              for (i = -1; (i = bitbag_next_bit(delayed_bits, i)) >= 0; ) {
-+                      struct file_struct *file = flist->files[i];
++                      struct file_struct *file = cur_flist->files[i];
 +                      if (local_name)
 +                              strlcpy(fbuf, local_name, sizeof fbuf);
 +                      else