Fixed failing hunks.
[rsync/rsync-patches.git] / flags.diff
index 4a008d0..66664f0 100644 (file)
@@ -31,7 +31,7 @@ TODO: fix --delete-delay to work with --flags option.
  extern int preserve_uid;
  extern int preserve_gid;
  extern int relative_paths;
-@@ -313,6 +314,9 @@ static void send_file_entry(struct file_
+@@ -312,6 +313,9 @@ static void send_file_entry(struct file_
        unsigned short flags;
        static time_t modtime;
        static mode_t mode;
@@ -41,7 +41,7 @@ TODO: fix --delete-delay to work with --flags option.
        static int64 dev;
        static dev_t rdev;
        static uint32 rdev_major;
-@@ -343,6 +347,12 @@ static void send_file_entry(struct file_
+@@ -342,6 +346,12 @@ static void send_file_entry(struct file_
                flags |= XMIT_SAME_MODE;
        else
                mode = file->mode;
@@ -54,7 +54,7 @@ TODO: fix --delete-delay to work with --flags option.
        if ((preserve_devices && IS_DEVICE(mode))
         || (preserve_specials && IS_SPECIAL(mode))) {
                if (protocol_version < 28) {
-@@ -429,6 +439,10 @@ static void send_file_entry(struct file_
+@@ -428,6 +438,10 @@ static void send_file_entry(struct file_
                write_int(f, modtime);
        if (!(flags & XMIT_SAME_MODE))
                write_int(f, to_wire_mode(mode));
@@ -65,7 +65,7 @@ TODO: fix --delete-delay to work with --flags option.
        if (preserve_uid && !(flags & XMIT_SAME_UID)) {
                if (!numeric_ids)
                        add_uid(uid);
-@@ -497,6 +511,9 @@ static struct file_struct *recv_file_ent
+@@ -496,6 +510,9 @@ static struct file_struct *recv_file_ent
  {
        static time_t modtime;
        static mode_t mode;
@@ -75,7 +75,7 @@ TODO: fix --delete-delay to work with --flags option.
        static int64 dev;
        static dev_t rdev;
        static uint32 rdev_major;
-@@ -571,9 +588,12 @@ static struct file_struct *recv_file_ent
+@@ -570,9 +587,12 @@ static struct file_struct *recv_file_ent
                modtime = (time_t)read_int(f);
        if (!(flags & XMIT_SAME_MODE))
                mode = from_wire_mode(read_int(f));
@@ -89,9 +89,9 @@ TODO: fix --delete-delay to work with --flags option.
  
        if (preserve_uid && !(flags & XMIT_SAME_UID))
                uid = (uid_t)read_int(f);
-@@ -639,6 +659,10 @@ static struct file_struct *recv_file_ent
-       file->modtime = modtime;
-       file->length = file_length;
+@@ -650,6 +670,10 @@ static struct file_struct *recv_file_ent
+               OPT_EXTRA(file, 0)->unum = (uint32)(file_length >> 32);
+       }
        file->mode = mode;
 +#ifdef SUPPORT_FLAGS
 +      if (preserve_fileflags)
@@ -100,9 +100,9 @@ TODO: fix --delete-delay to work with --flags option.
        if (preserve_uid)
                F_UID(file) = uid;
        if (preserve_gid)
-@@ -902,6 +926,10 @@ struct file_struct *make_file(const char
-       file->modtime = st.st_mtime;
-       file->length = st.st_size;
+@@ -926,6 +950,10 @@ struct file_struct *make_file(const char
+               OPT_EXTRA(file, 0)->unum = (uint32)(st.st_size >> 32);
+       }
        file->mode = st.st_mode;
 +#ifdef SUPPORT_FLAGS
 +      if (preserve_fileflags)
@@ -113,7 +113,7 @@ TODO: fix --delete-delay to work with --flags option.
        if (preserve_gid)
 --- old/generator.c
 +++ new/generator.c
-@@ -101,6 +101,12 @@ int non_perishable_cnt = 0;
+@@ -99,6 +99,12 @@ int non_perishable_cnt = 0;
  static int deletion_count = 0; /* used to implement --max-delete */
  static FILE *delete_delay_fp = NULL;
  
@@ -126,7 +126,7 @@ TODO: fix --delete-delay to work with --flags option.
  /* For calling delete_item() and delete_dir_contents(). */
  #define DEL_RECURSE           (1<<1) /* recurse */
  #define DEL_DIR_IS_EMPTY      (1<<2) /* internal delete_FUNCTIONS use only */
-@@ -116,7 +122,6 @@ enum delret {
+@@ -114,7 +120,6 @@ enum delret {
  /* Forward declaration for delete_item(). */
  static enum delret delete_dir_contents(char *fname, int flags);
  
@@ -134,7 +134,7 @@ TODO: fix --delete-delay to work with --flags option.
  static int is_backup_file(char *fn)
  {
        int k = strlen(fn) - backup_suffix_len;
-@@ -129,17 +134,20 @@ static int is_backup_file(char *fn)
+@@ -127,17 +132,20 @@ static int is_backup_file(char *fn)
   * Note that fbuf must point to a MAXPATHLEN buffer if the mode indicates it's
   * a directory! (The buffer is used for recursion, but returned unchanged.)
   */
@@ -158,7 +158,7 @@ TODO: fix --delete-delay to work with --flags option.
        if (S_ISDIR(mode) && !(flags & DEL_DIR_IS_EMPTY)) {
                ignore_perishable = 1;
                /* If DEL_RECURSE is not set, this just reports emptiness. */
-@@ -251,7 +259,7 @@ static enum delret delete_dir_contents(c
+@@ -249,7 +257,7 @@ static enum delret delete_dir_contents(c
                if (S_ISDIR(fp->mode)
                 && delete_dir_contents(fname, flags | DEL_RECURSE) != DR_SUCCESS)
                        ret = DR_NOT_EMPTY;
@@ -167,7 +167,7 @@ TODO: fix --delete-delay to work with --flags option.
                        ret = DR_NOT_EMPTY;
        }
  
-@@ -403,10 +411,10 @@ static void delete_in_dir(struct file_li
+@@ -401,10 +409,10 @@ static void delete_in_dir(struct file_li
                }
                if (flist_find(flist, fp) < 0) {
                        f_name(fp, delbuf);
@@ -180,7 +180,7 @@ TODO: fix --delete-delay to work with --flags option.
                }
        }
  
-@@ -1101,7 +1109,7 @@ static void recv_generator(char *fname, 
+@@ -1099,7 +1107,7 @@ static void recv_generator(char *fname, 
                 * we need to delete it.  If it doesn't exist, then
                 * (perhaps recursively) create it. */
                if (statret == 0 && !S_ISDIR(st.st_mode)) {
@@ -189,7 +189,7 @@ TODO: fix --delete-delay to work with --flags option.
                                return;
                        statret = -1;
                }
-@@ -1195,7 +1203,7 @@ static void recv_generator(char *fname, 
+@@ -1193,7 +1201,7 @@ static void recv_generator(char *fname, 
                        }
                        /* Not the right symlink (or not a symlink), so
                         * delete it. */
@@ -198,7 +198,7 @@ TODO: fix --delete-delay to work with --flags option.
                                return;
                } else if (basis_dir[0] != NULL) {
                        int j = try_dests_non(file, fname, ndx, fnamecmpbuf, &st,
-@@ -1267,7 +1275,7 @@ static void recv_generator(char *fname, 
+@@ -1265,7 +1273,7 @@ static void recv_generator(char *fname, 
                                        goto return_with_success;
                                return;
                        }
@@ -207,7 +207,7 @@ TODO: fix --delete-delay to work with --flags option.
                                return;
                } else if (basis_dir[0] != NULL) {
                        int j = try_dests_non(file, fname, ndx, fnamecmpbuf, &st,
-@@ -1353,7 +1361,7 @@ static void recv_generator(char *fname, 
+@@ -1351,7 +1359,7 @@ static void recv_generator(char *fname, 
        fnamecmp_type = FNAMECMP_FNAME;
  
        if (statret == 0 && !S_ISREG(st.st_mode)) {
@@ -290,11 +290,11 @@ TODO: fix --delete-delay to work with --flags option.
                snprintf(err_buf, sizeof err_buf,
                        "--write-batch and --read-batch can not be used together\n");
 @@ -1223,6 +1241,8 @@ int parse_arguments(int *argc, const cha
-               preserve_uid = flist_extra_ndx++;
+               preserve_uid = ++flist_extra_cnt;
        if (preserve_gid)
-               preserve_gid = flist_extra_ndx++;
+               preserve_gid = ++flist_extra_cnt;
 +      if (preserve_fileflags)
-+              preserve_fileflags = flist_extra_ndx++;
++              preserve_fileflags = ++flist_extra_cnt;
  
        *argv = poptGetArgs(pc);
        *argc = count_args(*argv);
@@ -411,7 +411,7 @@ TODO: fix --delete-delay to work with --flags option.
  
  /* These flags are used in the live flist data. */
  
-@@ -347,6 +348,10 @@ enum msgcode {
+@@ -348,6 +349,10 @@ enum msgcode {
  #define schar char
  #endif
  
@@ -422,14 +422,14 @@ TODO: fix --delete-delay to work with --flags option.
  /* Find a variable that is either exactly 32-bits or longer.
   * If some code depends on 32-bit truncation, it will need to
   * take special action in a "#if SIZEOF_INT32 > 4" section. */
-@@ -540,6 +545,7 @@ union flist_extras {
- /* When enabled, all entries have these: */
- #define F_UID(f) FLIST_EXTRA(f, preserve_uid).uid
- #define F_GID(f) FLIST_EXTRA(f, preserve_gid).gid
-+#define F_FFLAGS(f) FLIST_EXTRA(f, preserve_fileflags).num
+@@ -551,6 +556,7 @@ extern int preserve_gid;
+ /* When the associated option is on, all entries will have these present: */
+ #define F_UID(f) REQ_EXTRA(f, preserve_uid)->uid
+ #define F_GID(f) REQ_EXTRA(f, preserve_gid)->gid
++#define F_FFLAGS(f) REQ_EXTRA(f, preserve_fileflags).num
  
  /* These are per-entry optional and mutally exclusive: */
- #define F_IDEV(f) FLIST_EXTRA(f, flist_extra_ndx).idev
+ #define F_IDEV(f)  OPT_EXTRA(f, LEN64_BUMP(f))->idev
 --- old/rsync.yo
 +++ new/rsync.yo
 @@ -321,6 +321,7 @@ to the detailed description below for a