A patch from Antti Tapaninen.
[rsync/rsync-patches.git] / atimes.diff
index 51eae2b..19ba7e0 100644 (file)
@@ -51,7 +51,7 @@ After applying this patch, run these commands for a successful build:
                        f_name(f, NULL));
        }
  }
-@@ -306,6 +315,7 @@ static void send_file_entry(struct file_
+@@ -298,6 +307,7 @@ static void send_file_entry(struct file_
  {
        unsigned short flags;
        static time_t modtime;
@@ -59,7 +59,7 @@ After applying this patch, run these commands for a successful build:
        static mode_t mode;
        static int64 dev;
        static dev_t rdev;
-@@ -321,7 +331,7 @@ static void send_file_entry(struct file_
+@@ -313,7 +323,7 @@ static void send_file_entry(struct file_
  
        if (!file) {
                write_byte(f, 0);
@@ -68,7 +68,7 @@ After applying this patch, run these commands for a successful build:
                dev = 0, rdev = makedev(0, 0);
                rdev_major = 0;
                uid = 0, gid = 0;
-@@ -331,7 +341,7 @@ static void send_file_entry(struct file_
+@@ -323,7 +333,7 @@ static void send_file_entry(struct file_
  
        f_name(file, fname);
  
@@ -77,7 +77,7 @@ After applying this patch, run these commands for a successful build:
  
        if (file->mode == mode)
                flags |= XMIT_SAME_MODE;
-@@ -367,6 +377,12 @@ static void send_file_entry(struct file_
+@@ -359,6 +369,12 @@ static void send_file_entry(struct file_
                flags |= XMIT_SAME_TIME;
        else
                modtime = file->modtime;
@@ -90,7 +90,7 @@ After applying this patch, run these commands for a successful build:
  
  #ifdef SUPPORT_HARD_LINKS
        if (file->link_u.idev) {
-@@ -420,6 +436,8 @@ static void send_file_entry(struct file_
+@@ -412,6 +428,8 @@ static void send_file_entry(struct file_
                write_int(f, modtime);
        if (!(flags & XMIT_SAME_MODE))
                write_int(f, to_wire_mode(mode));
@@ -99,7 +99,7 @@ After applying this patch, run these commands for a successful build:
        if (preserve_uid && !(flags & XMIT_SAME_UID)) {
                if (!numeric_ids)
                        add_uid(uid);
-@@ -486,6 +504,7 @@ static struct file_struct *receive_file_
+@@ -478,6 +496,7 @@ static struct file_struct *receive_file_
                                              unsigned short flags, int f)
  {
        static time_t modtime;
@@ -107,7 +107,7 @@ After applying this patch, run these commands for a successful build:
        static mode_t mode;
        static int64 dev;
        static dev_t rdev;
-@@ -504,7 +523,7 @@ static struct file_struct *receive_file_
+@@ -496,7 +515,7 @@ static struct file_struct *receive_file_
        struct file_struct *file;
  
        if (!flist) {
@@ -116,7 +116,7 @@ After applying this patch, run these commands for a successful build:
                dev = 0, rdev = makedev(0, 0);
                rdev_major = 0;
                uid = 0, gid = 0;
-@@ -560,6 +579,8 @@ static struct file_struct *receive_file_
+@@ -552,6 +571,8 @@ static struct file_struct *receive_file_
                modtime = (time_t)read_int(f);
        if (!(flags & XMIT_SAME_MODE))
                mode = from_wire_mode(read_int(f));
@@ -125,7 +125,7 @@ After applying this patch, run these commands for a successful build:
  
        if (chmod_modes && !S_ISLNK(mode))
                mode = tweak_mode(mode, chmod_modes);
-@@ -615,6 +636,8 @@ static struct file_struct *receive_file_
+@@ -607,6 +628,8 @@ static struct file_struct *receive_file_
        file->mode = mode;
        file->uid = uid;
        file->gid = gid;
@@ -134,7 +134,7 @@ After applying this patch, run these commands for a successful build:
  
        if (dirname_len) {
                file->dirname = lastdir = bp;
-@@ -640,12 +663,12 @@ static struct file_struct *receive_file_
+@@ -632,12 +655,12 @@ static struct file_struct *receive_file_
                            && lastname[del_hier_name_len-1] == '.'
                            && lastname[del_hier_name_len-2] == '/')
                                del_hier_name_len -= 2;
@@ -149,7 +149,7 @@ After applying this patch, run these commands for a successful build:
                        else
                                in_del_hier = 0;
                }
-@@ -861,12 +884,14 @@ struct file_struct *make_file(char *fnam
+@@ -851,12 +874,14 @@ struct file_struct *make_file(char *fnam
        memset(bp, 0, file_struct_len);
        bp += file_struct_len;
  
@@ -165,7 +165,7 @@ After applying this patch, run these commands for a successful build:
  
  #ifdef SUPPORT_HARD_LINKS
        if (flist && flist->hlink_pool) {
-@@ -979,7 +1004,7 @@ static void send_if_directory(int f, str
+@@ -969,7 +994,7 @@ static void send_if_directory(int f, str
        char is_dot_dir = fbuf[ol-1] == '.' && (ol == 1 || fbuf[ol-2] == '/');
  
        if (S_ISDIR(file->mode)
@@ -174,7 +174,7 @@ After applying this patch, run these commands for a successful build:
                void *save_filters;
                unsigned int len = strlen(fbuf);
                if (len > 1 && fbuf[len-1] == '/')
-@@ -1585,8 +1610,9 @@ static void clean_flist(struct file_list
+@@ -1581,8 +1606,9 @@ static void clean_flist(struct file_list
                        }
                        /* Make sure we don't lose track of a user-specified
                         * top directory. */
@@ -186,7 +186,7 @@ After applying this patch, run these commands for a successful build:
  
                        clear_file(flist->files[drop], flist);
  
-@@ -1710,7 +1736,7 @@ static void output_flist(struct file_lis
+@@ -1706,7 +1732,7 @@ static void output_flist(struct file_lis
                        file->dirname ? file->dirname : "",
                        file->dirname ? "/" : "", NS(file->basename),
                        S_ISDIR(file->mode) ? "/" : "", (int)file->mode,
@@ -273,7 +273,7 @@ After applying this patch, run these commands for a successful build:
                        continue;
  
                name = fp->basename;
-@@ -656,6 +661,8 @@ static int try_dests_reg(struct file_str
+@@ -663,6 +668,8 @@ static int try_dests_reg(struct file_str
                                          itemizing && verbose > 1,
                                          code) < 0)
                                goto try_a_copy;
@@ -281,8 +281,8 @@ After applying this patch, run these commands for a successful build:
 +                              set_file_attrs(fname, file, stp, 0);
                        if (preserve_hard_links && file->link_u.links)
                                hard_link_cluster(file, ndx, itemizing, code);
-               } else if (itemizing)
-@@ -922,7 +929,7 @@ static void recv_generator(char *fname, 
+               } else
+@@ -929,7 +936,7 @@ static void recv_generator(char *fname, 
                    && verbose && code && f_out != -1)
                        rprintf(code, "%s/\n", fname);
                if (delete_during && f_out != -1 && !phase && dry_run < 2
@@ -291,7 +291,7 @@ After applying this patch, run these commands for a successful build:
                        delete_in_dir(the_file_list, fname, file, &st);
                return;
        }
-@@ -1211,7 +1218,7 @@ static void recv_generator(char *fname, 
+@@ -1218,7 +1225,7 @@ static void recv_generator(char *fname, 
        if (fuzzy_dirlist) {
                int j = flist_find(fuzzy_dirlist, file);
                if (j >= 0) /* don't use changing file as future fuzzy basis */
@@ -304,7 +304,7 @@ After applying this patch, run these commands for a successful build:
 +++ new/hlink.c
 @@ -28,6 +28,7 @@ extern int link_dest;
  extern int make_backups;
- extern int log_format_has_i;
+ extern int stdout_format_has_i;
  extern char *basis_dir[];
 +extern unsigned int file_struct_len;
  extern struct file_list *the_file_list;
@@ -358,10 +358,10 @@ After applying this patch, run these commands for a successful build:
  extern int protocol_version;
  extern int preserve_times;
 +extern int preserve_atimes;
- extern int log_format_has_i;
- extern int log_format_has_o_or_i;
- extern int daemon_log_format_has_o_or_i;
-@@ -603,7 +604,8 @@ static void log_formatted(enum logcode c
+ extern int stdout_format_has_i;
+ extern int stdout_format_has_o_or_i;
+ extern int logfile_format_has_o_or_i;
+@@ -594,7 +595,8 @@ static void log_formatted(enum logcode c
                        n[5] = !(iflags & ITEM_REPORT_PERMS) ? '.' : 'p';
                        n[6] = !(iflags & ITEM_REPORT_OWNER) ? '.' : 'o';
                        n[7] = !(iflags & ITEM_REPORT_GROUP) ? '.' : 'g';
@@ -381,7 +381,7 @@ After applying this patch, run these commands for a successful build:
  int update_only = 0;
  int cvs_exclude = 0;
  int dry_run = 0;
-@@ -301,8 +302,9 @@ void usage(enum logcode F)
+@@ -305,8 +306,9 @@ void usage(enum logcode F)
    rprintf(F,"     --devices               preserve device files (super-user only)\n");
    rprintf(F,"     --specials              preserve special files\n");
    rprintf(F," -D                          same as --devices --specials\n");
@@ -393,7 +393,7 @@ After applying this patch, run these commands for a successful build:
    rprintf(F,"     --super                 receiver attempts super-user activities\n");
    rprintf(F," -S, --sparse                handle sparse files efficiently\n");
    rprintf(F," -n, --dry-run               show what would have been transferred\n");
-@@ -413,6 +415,9 @@ static struct poptOption long_options[] 
+@@ -419,6 +421,9 @@ static struct poptOption long_options[] 
    {"times",           't', POPT_ARG_VAL,    &preserve_times, 1, 0, 0 },
    {"no-times",         0,  POPT_ARG_VAL,    &preserve_times, 0, 0, 0 },
    {"no-t",             0,  POPT_ARG_VAL,    &preserve_times, 0, 0, 0 },
@@ -403,7 +403,7 @@ After applying this patch, run these commands for a successful build:
    {"omit-dir-times",  'O', POPT_ARG_VAL,    &omit_dir_times, 2, 0, 0 },
    {"modify-window",    0,  POPT_ARG_INT,    &modify_window, OPT_MODIFY_WINDOW, 0, 0 },
    {"super",            0,  POPT_ARG_VAL,    &am_root, 2, 0, 0 },
-@@ -1518,6 +1523,8 @@ void server_options(char **args,int *arg
+@@ -1537,6 +1542,8 @@ void server_options(char **args,int *arg
                argstr[x++] = 'D';
        if (preserve_times)
                argstr[x++] = 't';
@@ -415,7 +415,7 @@ After applying this patch, run these commands for a successful build:
 --- old/rsync.c
 +++ new/rsync.c
 @@ -35,6 +35,7 @@ extern int dry_run;
- extern int daemon_log_format_has_i;
+ extern int logfile_format_has_i;
  extern int preserve_perms;
  extern int preserve_executability;
 +extern int preserve_atimes;
@@ -485,7 +485,7 @@ After applying this patch, run these commands for a successful build:
  
  #define FULL_FLUSH    1
  #define NORMAL_FLUSH  0
-@@ -522,9 +524,12 @@ struct file_struct {
+@@ -523,9 +525,12 @@ struct file_struct {
        uid_t uid;
        gid_t gid;
        mode_t mode;
@@ -513,7 +513,7 @@ After applying this patch, run these commands for a successful build:
       --super                 receiver attempts super-user activities
   -S, --sparse                handle sparse files efficiently
   -n, --dry-run               show what would have been transferred
-@@ -858,6 +859,12 @@ it is preserving modification times (see
+@@ -861,6 +862,12 @@ it is preserving modification times (see
  the directories on the receiving side, it is a good idea to use bf(-O).
  This option is inferred if you use bf(--backup) without bf(--backup-dir).
  
@@ -526,7 +526,7 @@ After applying this patch, run these commands for a successful build:
  dit(bf(--super)) This tells the receiving side to attempt super-user
  activities even if the receiving rsync wasn't run by the super-user.  These
  activities include: preserving users via the bf(--owner) option, preserving
-@@ -1373,7 +1380,7 @@ with older versions of rsync, but that a
+@@ -1378,7 +1385,7 @@ with older versions of rsync, but that a
  verbose messages).
  
  The "%i" escape has a cryptic output that is 9 letters long.  The general
@@ -535,7 +535,7 @@ After applying this patch, run these commands for a successful build:
  type of update being done, bf(X) is replaced by the file-type, and the
  other letters represent attributes that may be output if they are being
  modified.
-@@ -1413,7 +1420,7 @@ quote(itemize(
+@@ -1418,7 +1425,7 @@ quote(itemize(
    by the file transfer.
    it() A bf(t) means the modification time is different and is being updated
    to the sender's value (requires bf(--times)).  An alternate value of bf(T)
@@ -544,7 +544,7 @@ After applying this patch, run these commands for a successful build:
    anytime a symlink is transferred, or when a file or device is transferred
    without bf(--times).
    it() A bf(p) means the permissions are different and are being updated to
-@@ -1422,7 +1429,10 @@ quote(itemize(
+@@ -1427,7 +1434,10 @@ quote(itemize(
    sender's value (requires bf(--owner) and super-user privileges).
    it() A bf(g) means the group is different and is being updated to the
    sender's value (requires bf(--group) and the authority to set the group).
@@ -565,7 +565,7 @@ After applying this patch, run these commands for a successful build:
 +extern unsigned int file_struct_len;
  extern struct stats stats;
  extern struct file_list *the_file_list;
- extern char *log_format;
+ extern char *stdout_format;
 @@ -129,7 +130,7 @@ void successful_send(int ndx)
  
        file = the_file_list->files[ndx];
@@ -575,7 +575,7 @@ After applying this patch, run these commands for a successful build:
                return;
        if (file->dir.root) {
                offset = stringjoin(fname, sizeof fname,
-@@ -373,7 +374,7 @@ void send_files(struct file_list *flist,
+@@ -371,7 +372,7 @@ void send_files(struct file_list *flist,
                        rprintf(FINFO, "sender finished %s\n", fname);
  
                /* Flag that we actually sent this entry. */
@@ -783,7 +783,7 @@ After applying this patch, run these commands for a successful build:
  }
 --- old/util.c
 +++ new/util.c
-@@ -116,7 +116,7 @@ void overflow_exit(char *str)
+@@ -121,7 +121,7 @@ void overflow_exit(char *str)
        exit_cleanup(RERR_MALLOC);
  }
  
@@ -792,7 +792,7 @@ After applying this patch, run these commands for a successful build:
  {
  #if !defined HAVE_LUTIMES || !defined HAVE_UTIMES
        if (S_ISLNK(mode))
-@@ -124,9 +124,13 @@ int set_modtime(char *fname, time_t modt
+@@ -129,9 +129,13 @@ int set_modtime(char *fname, time_t modt
  #endif
  
        if (verbose > 2) {
@@ -808,7 +808,7 @@ After applying this patch, run these commands for a successful build:
        }
  
        if (dry_run)
-@@ -135,7 +139,7 @@ int set_modtime(char *fname, time_t modt
+@@ -140,7 +144,7 @@ int set_modtime(char *fname, time_t modt
        {
  #ifdef HAVE_UTIMES
                struct timeval t[2];
@@ -817,7 +817,7 @@ After applying this patch, run these commands for a successful build:
                t[0].tv_usec = 0;
                t[1].tv_sec = modtime;
                t[1].tv_usec = 0;
-@@ -146,12 +150,12 @@ int set_modtime(char *fname, time_t modt
+@@ -151,12 +155,12 @@ int set_modtime(char *fname, time_t modt
                return utimes(fname, t);
  #elif defined HAVE_UTIMBUF
                struct utimbuf tbuf;