Updated patches to work with the current trunk.
[rsync/rsync-patches.git] / crtimes.diff
index d83bd9a..6c5148b 100644 (file)
@@ -9,9 +9,10 @@ To use this patch, run these commands for a successful build:
     make
 
 diff --git a/compat.c b/compat.c
     make
 
 diff --git a/compat.c b/compat.c
+index ef1882d..132ff90 100644
 --- a/compat.c
 +++ b/compat.c
 --- a/compat.c
 +++ b/compat.c
-@@ -45,6 +45,7 @@ extern int force_change;
+@@ -44,6 +44,7 @@ extern int force_change;
  extern int protect_args;
  extern int preserve_uid;
  extern int preserve_gid;
  extern int protect_args;
  extern int preserve_uid;
  extern int preserve_gid;
@@ -19,7 +20,7 @@ diff --git a/compat.c b/compat.c
  extern int preserve_fileflags;
  extern int preserve_acls;
  extern int preserve_xattrs;
  extern int preserve_fileflags;
  extern int preserve_acls;
  extern int preserve_xattrs;
-@@ -63,7 +64,7 @@ extern char *iconv_opt;
+@@ -62,7 +63,7 @@ extern char *iconv_opt;
  #endif
  
  /* These index values are for the file-list's extra-attribute array. */
  #endif
  
  /* These index values are for the file-list's extra-attribute array. */
@@ -28,7 +29,7 @@ diff --git a/compat.c b/compat.c
  
  int receiver_symlink_times = 0; /* receiver can set the time on a symlink */
  int sender_symlink_iconv = 0; /* sender should convert symlink content */
  
  int receiver_symlink_times = 0; /* receiver can set the time on a symlink */
  int sender_symlink_iconv = 0; /* sender should convert symlink content */
-@@ -139,6 +140,8 @@ void setup_protocol(int f_out,int f_in)
+@@ -138,6 +139,8 @@ void setup_protocol(int f_out,int f_in)
                uid_ndx = ++file_extra_cnt;
        if (preserve_gid)
                gid_ndx = ++file_extra_cnt;
                uid_ndx = ++file_extra_cnt;
        if (preserve_gid)
                gid_ndx = ++file_extra_cnt;
@@ -38,9 +39,10 @@ diff --git a/compat.c b/compat.c
                fileflags_ndx = ++file_extra_cnt;
        if (preserve_acls && !am_sender)
 diff --git a/flist.c b/flist.c
                fileflags_ndx = ++file_extra_cnt;
        if (preserve_acls && !am_sender)
 diff --git a/flist.c b/flist.c
+index e1d01be..3287447 100644
 --- a/flist.c
 +++ b/flist.c
 --- a/flist.c
 +++ b/flist.c
-@@ -56,6 +56,7 @@ extern int preserve_fileflags;
+@@ -56,6 +56,7 @@ extern int missing_args;
  extern int uid_ndx;
  extern int gid_ndx;
  extern int eol_nulls;
  extern int uid_ndx;
  extern int gid_ndx;
  extern int eol_nulls;
@@ -48,7 +50,7 @@ diff --git a/flist.c b/flist.c
  extern int relative_paths;
  extern int implied_dirs;
  extern int file_extra_cnt;
  extern int relative_paths;
  extern int implied_dirs;
  extern int file_extra_cnt;
-@@ -394,7 +395,7 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
+@@ -397,7 +398,7 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
  #endif
                            int ndx, int first_ndx)
  {
  #endif
                            int ndx, int first_ndx)
  {
@@ -57,7 +59,7 @@ diff --git a/flist.c b/flist.c
        static mode_t mode;
  #ifdef SUPPORT_FILEFLAGS
        static uint32 fileflags;
        static mode_t mode;
  #ifdef SUPPORT_FILEFLAGS
        static uint32 fileflags;
-@@ -479,6 +480,13 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
+@@ -496,6 +497,13 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
                xflags |= XMIT_SAME_TIME;
        else
                modtime = file->modtime;
                xflags |= XMIT_SAME_TIME;
        else
                modtime = file->modtime;
@@ -71,7 +73,7 @@ diff --git a/flist.c b/flist.c
  
  #ifdef SUPPORT_HARD_LINKS
        if (tmp_dev != 0) {
  
  #ifdef SUPPORT_HARD_LINKS
        if (tmp_dev != 0) {
-@@ -548,6 +556,8 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
+@@ -578,6 +586,8 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
                else
                        write_int(f, modtime);
        }
                else
                        write_int(f, modtime);
        }
@@ -80,7 +82,7 @@ diff --git a/flist.c b/flist.c
        if (!(xflags & XMIT_SAME_MODE))
                write_int(f, to_wire_mode(mode));
  #ifdef SUPPORT_FILEFLAGS
        if (!(xflags & XMIT_SAME_MODE))
                write_int(f, to_wire_mode(mode));
  #ifdef SUPPORT_FILEFLAGS
-@@ -638,7 +648,7 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
+@@ -670,7 +680,7 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
  static struct file_struct *recv_file_entry(struct file_list *flist,
                                           int xflags, int f)
  {
  static struct file_struct *recv_file_entry(struct file_list *flist,
                                           int xflags, int f)
  {
@@ -89,16 +91,7 @@ diff --git a/flist.c b/flist.c
        static mode_t mode;
  #ifdef SUPPORT_FILEFLAGS
        static uint32 fileflags;
        static mode_t mode;
  #ifdef SUPPORT_FILEFLAGS
        static uint32 fileflags;
-@@ -744,6 +754,8 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
-                               uid = F_OWNER(first);
-                       if (preserve_gid)
-                               gid = F_GROUP(first);
-+                      if (crtimes_ndx)
-+                              crtime = f_crtime(first);
-                       if ((preserve_devices && IS_DEVICE(mode))
-                        || (preserve_specials && IS_SPECIAL(mode))) {
-                               uint32 *devp = F_RDEV_P(first);
-@@ -773,6 +785,19 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
+@@ -810,6 +820,19 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
                } else
                        modtime = read_int(f);
        }
                } else
                        modtime = read_int(f);
        }
@@ -118,7 +111,7 @@ diff --git a/flist.c b/flist.c
        if (!(xflags & XMIT_SAME_MODE))
                mode = from_wire_mode(read_int(f));
  
        if (!(xflags & XMIT_SAME_MODE))
                mode = from_wire_mode(read_int(f));
  
-@@ -932,6 +957,8 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
+@@ -969,6 +992,8 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
                F_GROUP(file) = gid;
                file->flags |= gid_flags;
        }
                F_GROUP(file) = gid;
                file->flags |= gid_flags;
        }
@@ -127,7 +120,7 @@ diff --git a/flist.c b/flist.c
        if (unsort_ndx)
                F_NDX(file) = flist->used + flist->ndx_start;
  
        if (unsort_ndx)
                F_NDX(file) = flist->used + flist->ndx_start;
  
-@@ -1308,6 +1335,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1358,6 +1383,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
                F_OWNER(file) = st.st_uid;
        if (gid_ndx) /* Check gid_ndx instead of preserve_gid for del support */
                F_GROUP(file) = st.st_gid;
                F_OWNER(file) = st.st_uid;
        if (gid_ndx) /* Check gid_ndx instead of preserve_gid for del support */
                F_GROUP(file) = st.st_gid;
@@ -137,17 +130,10 @@ diff --git a/flist.c b/flist.c
        if (basename != thisname)
                file->dirname = lastdir;
 diff --git a/generator.c b/generator.c
        if (basename != thisname)
                file->dirname = lastdir;
 diff --git a/generator.c b/generator.c
+index eee42e8..932f81c 100644
 --- a/generator.c
 +++ b/generator.c
 --- a/generator.c
 +++ b/generator.c
-@@ -21,6 +21,7 @@
-  */
- #include "rsync.h"
-+#include "ifuncs.h"
- extern int verbose;
- extern int dry_run;
-@@ -40,6 +41,7 @@ extern int preserve_xattrs;
+@@ -40,6 +40,7 @@ extern int preserve_xattrs;
  extern int preserve_links;
  extern int preserve_devices;
  extern int preserve_specials;
  extern int preserve_links;
  extern int preserve_devices;
  extern int preserve_specials;
@@ -155,7 +141,7 @@ diff --git a/generator.c b/generator.c
  extern int preserve_hard_links;
  extern int preserve_executability;
  extern int preserve_fileflags;
  extern int preserve_hard_links;
  extern int preserve_executability;
  extern int preserve_fileflags;
-@@ -623,6 +625,13 @@ int unchanged_attrs(const char *fname, struct file_struct *file, stat_x *sxp)
+@@ -419,6 +420,13 @@ int unchanged_attrs(const char *fname, struct file_struct *file, stat_x *sxp)
        if (gid_ndx && !(file->flags & FLAG_SKIP_GROUP) && sxp->st.st_gid != (gid_t)F_GROUP(file))
                return 0;
  
        if (gid_ndx && !(file->flags & FLAG_SKIP_GROUP) && sxp->st.st_gid != (gid_t)F_GROUP(file))
                return 0;
  
@@ -169,7 +155,7 @@ diff --git a/generator.c b/generator.c
  #ifdef SUPPORT_ACLS
        if (preserve_acls && !S_ISLNK(file->mode)) {
                if (!ACL_READY(*sxp))
  #ifdef SUPPORT_ACLS
        if (preserve_acls && !S_ISLNK(file->mode)) {
                if (!ACL_READY(*sxp))
-@@ -666,6 +675,12 @@ void itemize(const char *fnamecmp, struct file_struct *file, int ndx, int statre
+@@ -462,6 +470,12 @@ void itemize(const char *fnamecmp, struct file_struct *file, int ndx, int statre
                 : iflags & (ITEM_TRANSFER|ITEM_LOCAL_CHANGE) && !(iflags & ITEM_MATCHED)
                  && (!(iflags & ITEM_XNAME_FOLLOWS) || *xname))
                        iflags |= ITEM_REPORT_TIME;
                 : iflags & (ITEM_TRANSFER|ITEM_LOCAL_CHANGE) && !(iflags & ITEM_MATCHED)
                  && (!(iflags & ITEM_XNAME_FOLLOWS) || *xname))
                        iflags |= ITEM_REPORT_TIME;
@@ -182,65 +168,57 @@ diff --git a/generator.c b/generator.c
  #if !defined HAVE_LCHMOD && !defined HAVE_SETATTRLIST
                if (S_ISLNK(file->mode)) {
                        ;
  #if !defined HAVE_LCHMOD && !defined HAVE_SETATTRLIST
                if (S_ISLNK(file->mode)) {
                        ;
-@@ -1226,6 +1241,7 @@ static int try_dests_non(struct file_struct *file, char *fname, int ndx,
+@@ -1022,6 +1036,7 @@ static int try_dests_non(struct file_struct *file, char *fname, int ndx,
  static void list_file_entry(struct file_struct *f)
  {
        char permbuf[PERMSTRING_SIZE];
 +      time_t crtime = crtimes_ndx ? f_crtime(f) : 0;
  static void list_file_entry(struct file_struct *f)
  {
        char permbuf[PERMSTRING_SIZE];
 +      time_t crtime = crtimes_ndx ? f_crtime(f) : 0;
-       double len;
+       int64 len;
+       int colwidth = human_readable ? 14 : 11;
  
  
-       if (!F_IS_ACTIVE(f)) {
-@@ -1240,14 +1256,16 @@ static void list_file_entry(struct file_struct *f)
+@@ -1037,10 +1052,11 @@ static void list_file_entry(struct file_struct *f)
  
  #ifdef SUPPORT_LINKS
        if (preserve_links && S_ISLNK(f->mode)) {
  
  #ifdef SUPPORT_LINKS
        if (preserve_links && S_ISLNK(f->mode)) {
--              rprintf(FINFO, "%s %11.0f %s %s -> %s\n",
-+              rprintf(FINFO, "%s %11.0f %s %s %s -> %s\n",
-                       permbuf, len, timestring(f->modtime),
+-              rprintf(FINFO, "%s %*s %s %s -> %s\n",
++              rprintf(FINFO, "%s %*s %s %s %s -> %s\n",
+                       permbuf, colwidth, comma_num(len),
+-                      timestring(f->modtime), f_name(f, NULL),
+-                      F_SYMLINK(f));
++                      timestring(f->modtime),
 +                      crtimes_ndx ? timestring(crtime) : "",
 +                      crtimes_ndx ? timestring(crtime) : "",
-                       f_name(f, NULL), F_SYMLINK(f));
++                      f_name(f, NULL), F_SYMLINK(f));
        } else
  #endif
        } else
  #endif
-       {
--              rprintf(FINFO, "%s %11.0f %s %s\n",
-+              rprintf(FINFO, "%s %11.0f %s %s %s\n",
-                       permbuf, len, timestring(f->modtime),
-+                      crtimes_ndx ? timestring(crtime) : "",
+       if (missing_args == 2 && f->mode == 0) {
+@@ -1048,9 +1064,11 @@ static void list_file_entry(struct file_struct *f)
+                       colwidth + 31, "*missing",
                        f_name(f, NULL));
                        f_name(f, NULL));
+       } else {
+-              rprintf(FINFO, "%s %*s %s %s\n",
++              rprintf(FINFO, "%s %*s %s %s %s\n",
+                       permbuf, colwidth, comma_num(len),
+-                      timestring(f->modtime), f_name(f, NULL));
++                      timestring(f->modtime),
++                      crtimes_ndx ? timestring(crtime) : "",
++                      f_name(f, NULL));
        }
  }
        }
  }
-@@ -1339,6 +1357,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
+@@ -1141,6 +1159,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
                        return;
                }
        }
 +      sx.crtime = 0;
  
                        return;
                }
        }
 +      sx.crtime = 0;
  
- #ifdef SUPPORT_ACLS
-       sx.acc_acl = sx.def_acl = NULL;
-diff --git a/hlink.c b/hlink.c
---- a/hlink.c
-+++ b/hlink.c
-@@ -366,6 +366,7 @@ int hard_link_check(struct file_struct *file, int ndx, const char *fname,
-               char cmpbuf[MAXPATHLEN];
-               stat_x alt_sx;
-               int j = 0;
-+              alt_sx.crtime = 0;
- #ifdef SUPPORT_ACLS
-               alt_sx.acc_acl = alt_sx.def_acl = NULL;
- #endif
-@@ -494,6 +495,7 @@ void finish_hard_link(struct file_struct *file, const char *fname, int fin_ndx,
-       } else
-               our_name = fname;
-+      prev_sx.crtime = 0;
- #ifdef SUPPORT_ACLS
-       prev_sx.acc_acl = prev_sx.def_acl = NULL;
- #endif
+       init_stat_x(&sx);
+       if (dry_run > 1 || (dry_missing_dir && is_below(file, dry_missing_dir))) {
 diff --git a/ifuncs.h b/ifuncs.h
 diff --git a/ifuncs.h b/ifuncs.h
+index 8c128d5..4254dfb 100644
 --- a/ifuncs.h
 +++ b/ifuncs.h
 --- a/ifuncs.h
 +++ b/ifuncs.h
-@@ -67,6 +67,28 @@ d_name(struct dirent *di)
- #endif
+@@ -35,6 +35,28 @@ realloc_xbuf(xbuf *xb, size_t sz)
+       xb->size = sz;
  }
  
 +static inline time_t
  }
  
 +static inline time_t
@@ -266,12 +244,13 @@ diff --git a/ifuncs.h b/ifuncs.h
 +}
 +
  static inline int
 +}
 +
  static inline int
isDigit(const char *ptr)
to_wire_mode(mode_t mode)
  {
 diff --git a/log.c b/log.c
  {
 diff --git a/log.c b/log.c
+index 83948b1..7a1d9ce 100644
 --- a/log.c
 +++ b/log.c
 --- a/log.c
 +++ b/log.c
-@@ -663,7 +663,8 @@ static void log_formatted(enum logcode code, const char *format, const char *op,
+@@ -718,7 +718,8 @@ static void log_formatted(enum logcode code, const char *format, const char *op,
                        c[8] = !(iflags & ITEM_REPORT_FFLAGS) ? '.' : 'f';
                        c[9] = !(iflags & ITEM_REPORT_ACL) ? '.' : 'a';
                        c[10] = !(iflags & ITEM_REPORT_XATTR) ? '.' : 'x';
                        c[8] = !(iflags & ITEM_REPORT_FFLAGS) ? '.' : 'f';
                        c[9] = !(iflags & ITEM_REPORT_ACL) ? '.' : 'a';
                        c[10] = !(iflags & ITEM_REPORT_XATTR) ? '.' : 'x';
@@ -282,6 +261,7 @@ diff --git a/log.c b/log.c
                        if (iflags & (ITEM_IS_NEW|ITEM_MISSING_DATA)) {
                                char ch = iflags & ITEM_IS_NEW ? '+' : '?';
 diff --git a/options.c b/options.c
                        if (iflags & (ITEM_IS_NEW|ITEM_MISSING_DATA)) {
                                char ch = iflags & ITEM_IS_NEW ? '+' : '?';
 diff --git a/options.c b/options.c
+index ae3d2d0..bb3bad3 100644
 --- a/options.c
 +++ b/options.c
 @@ -60,6 +60,7 @@ int preserve_specials = 0;
 --- a/options.c
 +++ b/options.c
 @@ -60,6 +60,7 @@ int preserve_specials = 0;
@@ -292,7 +272,7 @@ diff --git a/options.c b/options.c
  int update_only = 0;
  int cvs_exclude = 0;
  int dry_run = 0;
  int update_only = 0;
  int cvs_exclude = 0;
  int dry_run = 0;
-@@ -363,6 +364,7 @@ void usage(enum logcode F)
+@@ -707,6 +708,7 @@ void usage(enum logcode F)
    rprintf(F," -D                          same as --devices --specials\n");
    rprintf(F," -t, --times                 preserve modification times\n");
    rprintf(F," -O, --omit-dir-times        omit directories from --times\n");
    rprintf(F," -D                          same as --devices --specials\n");
    rprintf(F," -t, --times                 preserve modification times\n");
    rprintf(F," -O, --omit-dir-times        omit directories from --times\n");
@@ -300,7 +280,7 @@ diff --git a/options.c b/options.c
    rprintf(F,"     --super                 receiver attempts super-user activities\n");
  #ifdef SUPPORT_XATTRS
    rprintf(F,"     --fake-super            store/recover privileged attrs using xattrs\n");
    rprintf(F,"     --super                 receiver attempts super-user activities\n");
  #ifdef SUPPORT_XATTRS
    rprintf(F,"     --fake-super            store/recover privileged attrs using xattrs\n");
-@@ -509,6 +511,9 @@ static struct poptOption long_options[] = {
+@@ -863,6 +865,9 @@ static struct poptOption long_options[] = {
    {"times",           't', POPT_ARG_VAL,    &preserve_times, 2, 0, 0 },
    {"no-times",         0,  POPT_ARG_VAL,    &preserve_times, 0, 0, 0 },
    {"no-t",             0,  POPT_ARG_VAL,    &preserve_times, 0, 0, 0 },
    {"times",           't', POPT_ARG_VAL,    &preserve_times, 2, 0, 0 },
    {"no-times",         0,  POPT_ARG_VAL,    &preserve_times, 0, 0, 0 },
    {"no-t",             0,  POPT_ARG_VAL,    &preserve_times, 0, 0, 0 },
@@ -310,7 +290,7 @@ diff --git a/options.c b/options.c
    {"omit-dir-times",  'O', POPT_ARG_VAL,    &omit_dir_times, 1, 0, 0 },
    {"no-omit-dir-times",0,  POPT_ARG_VAL,    &omit_dir_times, 0, 0, 0 },
    {"no-O",             0,  POPT_ARG_VAL,    &omit_dir_times, 0, 0, 0 },
    {"omit-dir-times",  'O', POPT_ARG_VAL,    &omit_dir_times, 1, 0, 0 },
    {"no-omit-dir-times",0,  POPT_ARG_VAL,    &omit_dir_times, 0, 0, 0 },
    {"no-O",             0,  POPT_ARG_VAL,    &omit_dir_times, 0, 0, 0 },
-@@ -1800,6 +1805,8 @@ void server_options(char **args, int *argc_p)
+@@ -2315,6 +2320,8 @@ void server_options(char **args, int *argc_p)
                argstr[x++] = 'D';
        if (preserve_times)
                argstr[x++] = 't';
                argstr[x++] = 'D';
        if (preserve_times)
                argstr[x++] = 't';
@@ -320,17 +300,10 @@ diff --git a/options.c b/options.c
                argstr[x++] = 'p';
        else if (preserve_executability && am_sender)
 diff --git a/rsync.c b/rsync.c
                argstr[x++] = 'p';
        else if (preserve_executability && am_sender)
 diff --git a/rsync.c b/rsync.c
+index 3188535..ab4f8e4 100644
 --- a/rsync.c
 +++ b/rsync.c
 --- a/rsync.c
 +++ b/rsync.c
-@@ -428,6 +428,7 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp,
-                               full_fname(fname));
-                       return 0;
-               }
-+              sx2.crtime = 0;
- #ifdef SUPPORT_ACLS
-               sx2.acc_acl = sx2.def_acl = NULL;
- #endif
-@@ -475,6 +476,14 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp,
+@@ -471,6 +471,14 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp,
                else
                        file->flags |= FLAG_TIME_FAILED;
        }
                else
                        file->flags |= FLAG_TIME_FAILED;
        }
@@ -345,7 +318,7 @@ diff --git a/rsync.c b/rsync.c
  
        change_uid = am_root && uid_ndx && sxp->st.st_uid != (uid_t)F_OWNER(file);
        change_gid = gid_ndx && !(file->flags & FLAG_SKIP_GROUP)
  
        change_uid = am_root && uid_ndx && sxp->st.st_uid != (uid_t)F_OWNER(file);
        change_gid = gid_ndx && !(file->flags & FLAG_SKIP_GROUP)
-@@ -622,7 +631,7 @@ int finish_transfer(const char *fname, const char *fnametmp,
+@@ -619,7 +627,7 @@ int finish_transfer(const char *fname, const char *fnametmp,
        /* Change permissions before putting the file into place. */
        set_file_attrs(fnametmp, file, NULL, fnamecmp,
                       ATTRS_DELAY_IMMUTABLE
        /* Change permissions before putting the file into place. */
        set_file_attrs(fnametmp, file, NULL, fnamecmp,
                       ATTRS_DELAY_IMMUTABLE
@@ -353,8 +326,8 @@ diff --git a/rsync.c b/rsync.c
 +                     | (ok_to_set_time ? 0 : ATTRS_SKIP_MTIME | ATTRS_SKIP_CRTIME));
  
        /* move tmp file over real file */
 +                     | (ok_to_set_time ? 0 : ATTRS_SKIP_MTIME | ATTRS_SKIP_CRTIME));
  
        /* move tmp file over real file */
-       if (verbose > 2)
-@@ -653,7 +662,7 @@ int finish_transfer(const char *fname, const char *fnametmp,
+       if (DEBUG_GTE(RECV, 1))
+@@ -650,7 +658,7 @@ int finish_transfer(const char *fname, const char *fnametmp,
  
    do_set_file_attrs:
        set_file_attrs(fnametmp, file, NULL, fnamecmp,
  
    do_set_file_attrs:
        set_file_attrs(fnametmp, file, NULL, fnamecmp,
@@ -364,17 +337,18 @@ diff --git a/rsync.c b/rsync.c
        if (temp_copy_name) {
                if (do_rename(fnametmp, fname) < 0) {
 diff --git a/rsync.h b/rsync.h
        if (temp_copy_name) {
                if (do_rename(fnametmp, fname) < 0) {
 diff --git a/rsync.h b/rsync.h
+index 16820fd..b3973c8 100644
 --- a/rsync.h
 +++ b/rsync.h
 --- a/rsync.h
 +++ b/rsync.h
-@@ -60,6 +60,7 @@
- #define XMIT_RDEV_MINOR_8_pre30 (1<<11)       /* protocols 28 - 29  */
+@@ -61,6 +61,7 @@
  #define XMIT_GROUP_NAME_FOLLOWS (1<<11) /* protocols 30 - now */
  #define XMIT_HLINK_FIRST (1<<12)      /* protocols 30 - now (HLINKED files only) */
  #define XMIT_GROUP_NAME_FOLLOWS (1<<11) /* protocols 30 - now */
  #define XMIT_HLINK_FIRST (1<<12)      /* protocols 30 - now (HLINKED files only) */
+ #define XMIT_IO_ERROR_ENDLIST (1<<12) /* protocols 31 - now (w/XMIT_EXTENDED_FLAGS) */
 +#define XMIT_CRTIME_EQ_MTIME (1<<13)  /* protocols ?? - now */
  #define XMIT_SAME_FLAGS (1<<14)               /* protocols ?? - now */
  
  /* These flags are used in the live flist data. */
 +#define XMIT_CRTIME_EQ_MTIME (1<<13)  /* protocols ?? - now */
  #define XMIT_SAME_FLAGS (1<<14)               /* protocols ?? - now */
  
  /* These flags are used in the live flist data. */
-@@ -156,6 +157,7 @@
+@@ -157,6 +158,7 @@
  #define ATTRS_REPORT          (1<<0)
  #define ATTRS_SKIP_MTIME      (1<<1)
  #define ATTRS_DELAY_IMMUTABLE (1<<2)
  #define ATTRS_REPORT          (1<<0)
  #define ATTRS_SKIP_MTIME      (1<<1)
  #define ATTRS_DELAY_IMMUTABLE (1<<2)
@@ -382,7 +356,7 @@ diff --git a/rsync.h b/rsync.h
  
  #define FULL_FLUSH    1
  #define NORMAL_FLUSH  0
  
  #define FULL_FLUSH    1
  #define NORMAL_FLUSH  0
-@@ -172,7 +174,7 @@
+@@ -173,7 +175,7 @@
  #define FNAMECMP_FUZZY                0x83
  
  /* For use by the itemize_changes code */
  #define FNAMECMP_FUZZY                0x83
  
  /* For use by the itemize_changes code */
@@ -391,7 +365,7 @@ diff --git a/rsync.h b/rsync.h
  #define ITEM_REPORT_CHANGE (1<<1)
  #define ITEM_REPORT_SIZE (1<<2)     /* regular files only */
  #define ITEM_REPORT_TIMEFAIL (1<<2) /* symlinks only */
  #define ITEM_REPORT_CHANGE (1<<1)
  #define ITEM_REPORT_SIZE (1<<2)     /* regular files only */
  #define ITEM_REPORT_TIMEFAIL (1<<2) /* symlinks only */
-@@ -657,6 +659,7 @@ extern int file_extra_cnt;
+@@ -677,6 +679,7 @@ extern int file_extra_cnt;
  extern int inc_recurse;
  extern int uid_ndx;
  extern int gid_ndx;
  extern int inc_recurse;
  extern int uid_ndx;
  extern int gid_ndx;
@@ -399,7 +373,7 @@ diff --git a/rsync.h b/rsync.h
  extern int fileflags_ndx;
  extern int acls_ndx;
  extern int xattrs_ndx;
  extern int fileflags_ndx;
  extern int acls_ndx;
  extern int xattrs_ndx;
-@@ -664,6 +667,7 @@ extern int xattrs_ndx;
+@@ -684,6 +687,7 @@ extern int xattrs_ndx;
  #define FILE_STRUCT_LEN (offsetof(struct file_struct, basename))
  #define EXTRA_LEN (sizeof (union file_extras))
  #define PTR_EXTRA_CNT ((sizeof (char *) + EXTRA_LEN - 1) / EXTRA_LEN)
  #define FILE_STRUCT_LEN (offsetof(struct file_struct, basename))
  #define EXTRA_LEN (sizeof (union file_extras))
  #define PTR_EXTRA_CNT ((sizeof (char *) + EXTRA_LEN - 1) / EXTRA_LEN)
@@ -407,7 +381,7 @@ diff --git a/rsync.h b/rsync.h
  #define DEV_EXTRA_CNT 2
  #define DIRNODE_EXTRA_CNT 3
  #define SUM_EXTRA_CNT ((MAX_DIGEST_LEN + EXTRA_LEN - 1) / EXTRA_LEN)
  #define DEV_EXTRA_CNT 2
  #define DIRNODE_EXTRA_CNT 3
  #define SUM_EXTRA_CNT ((MAX_DIGEST_LEN + EXTRA_LEN - 1) / EXTRA_LEN)
-@@ -931,6 +935,7 @@ typedef struct {
+@@ -954,6 +958,7 @@ typedef struct {
  
  typedef struct {
      STRUCT_STAT st;
  
  typedef struct {
      STRUCT_STAT st;
@@ -416,9 +390,10 @@ diff --git a/rsync.h b/rsync.h
      struct rsync_acl *acc_acl; /* access ACL */
      struct rsync_acl *def_acl; /* default ACL */
 diff --git a/rsync.yo b/rsync.yo
      struct rsync_acl *acc_acl; /* access ACL */
      struct rsync_acl *def_acl; /* default ACL */
 diff --git a/rsync.yo b/rsync.yo
+index 7b41d5f..5670c46 100644
 --- a/rsync.yo
 +++ b/rsync.yo
 --- a/rsync.yo
 +++ b/rsync.yo
-@@ -354,6 +354,7 @@ to the detailed description below for a complete description.  verb(
+@@ -357,6 +357,7 @@ to the detailed description below for a complete description.  verb(
   -D                          same as --devices --specials
   -t, --times                 preserve modification times
   -O, --omit-dir-times        omit directories from --times
   -D                          same as --devices --specials
   -t, --times                 preserve modification times
   -O, --omit-dir-times        omit directories from --times
@@ -426,7 +401,7 @@ diff --git a/rsync.yo b/rsync.yo
       --super                 receiver attempts super-user activities
       --fake-super            store/recover privileged attrs using xattrs
   -S, --sparse                handle sparse files efficiently
       --super                 receiver attempts super-user activities
       --fake-super            store/recover privileged attrs using xattrs
   -S, --sparse                handle sparse files efficiently
-@@ -1032,6 +1033,9 @@ it is preserving modification times (see bf(--times)).  If NFS is sharing
+@@ -1099,6 +1100,9 @@ it is preserving modification times (see bf(--times)).  If NFS is sharing
  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).
  
  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).
  
@@ -436,7 +411,7 @@ diff --git a/rsync.yo b/rsync.yo
  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
  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
-@@ -1696,7 +1700,7 @@ with older versions of rsync, but that also turns on the output of other
+@@ -1861,7 +1865,7 @@ with older versions of rsync, but that also turns on the output of other
  verbose messages).
  
  The "%i" escape has a cryptic output that is 11 letters long.  The general
  verbose messages).
  
  The "%i" escape has a cryptic output that is 11 letters long.  The general
@@ -445,7 +420,7 @@ diff --git a/rsync.yo b/rsync.yo
  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.
  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.
-@@ -1755,6 +1759,8 @@ quote(itemization(
+@@ -1920,6 +1924,8 @@ quote(itemization(
    it() The bf(f) means that the fileflags information changed.
    it() The bf(a) means that the ACL information changed.
    it() The bf(x) means that the extended attribute information changed.
    it() The bf(f) means that the fileflags information changed.
    it() The bf(a) means that the ACL information changed.
    it() The bf(x) means that the extended attribute information changed.
@@ -455,6 +430,7 @@ diff --git a/rsync.yo b/rsync.yo
  
  One other output is possible:  when deleting files, the "%i" will output
 diff --git a/syscall.c b/syscall.c
  
  One other output is possible:  when deleting files, the "%i" will output
 diff --git a/syscall.c b/syscall.c
+index 45604b1..c463997 100644
 --- a/syscall.c
 +++ b/syscall.c
 @@ -37,6 +37,11 @@ extern int force_change;
 --- a/syscall.c
 +++ b/syscall.c
 @@ -37,6 +37,11 @@ extern int force_change;
@@ -505,6 +481,7 @@ diff --git a/syscall.c b/syscall.c
 +}
 diff --git a/testsuite/crtimes.test b/testsuite/crtimes.test
 new file mode 100644
 +}
 diff --git a/testsuite/crtimes.test b/testsuite/crtimes.test
 new file mode 100644
+index 0000000..b904e16
 --- /dev/null
 +++ b/testsuite/crtimes.test
 @@ -0,0 +1,24 @@
 --- /dev/null
 +++ b/testsuite/crtimes.test
 @@ -0,0 +1,24 @@
@@ -533,6 +510,7 @@ new file mode 100644
 +# The script would have aborted on error, so getting here means we've won.
 +exit 0
 diff --git a/testsuite/rsync.fns b/testsuite/rsync.fns
 +# The script would have aborted on error, so getting here means we've won.
 +exit 0
 diff --git a/testsuite/rsync.fns b/testsuite/rsync.fns
+index b26aee3..4faaf93 100644
 --- a/testsuite/rsync.fns
 +++ b/testsuite/rsync.fns
 @@ -24,9 +24,9 @@ todir="$tmpdir/to"
 --- a/testsuite/rsync.fns
 +++ b/testsuite/rsync.fns
 @@ -24,9 +24,9 @@ todir="$tmpdir/to"
@@ -549,9 +527,10 @@ diff --git a/testsuite/rsync.fns b/testsuite/rsync.fns
  # Berkley's nice.
  PATH="$PATH:/usr/ucb"
 diff --git a/tls.c b/tls.c
  # Berkley's nice.
  PATH="$PATH:/usr/ucb"
 diff --git a/tls.c b/tls.c
+index 8cc5748..6da4df9 100644
 --- a/tls.c
 +++ b/tls.c
 --- a/tls.c
 +++ b/tls.c
-@@ -107,6 +107,8 @@ static int stat_xattr(const char *fname, STRUCT_STAT *fst)
+@@ -108,6 +108,8 @@ static int stat_xattr(const char *fname, STRUCT_STAT *fst)
  
  #endif
  
  
  #endif
  
@@ -560,7 +539,7 @@ diff --git a/tls.c b/tls.c
  static void failed(char const *what, char const *where)
  {
        fprintf(stderr, PROGRAM ": %s %s: %s\n",
  static void failed(char const *what, char const *where)
  {
        fprintf(stderr, PROGRAM ": %s %s: %s\n",
-@@ -114,16 +116,36 @@ static void failed(char const *what, char const *where)
+@@ -115,16 +117,36 @@ static void failed(char const *what, char const *where)
        exit(1);
  }
  
        exit(1);
  }
  
@@ -599,7 +578,7 @@ diff --git a/tls.c b/tls.c
  #ifdef SUPPORT_XATTRS
        if (am_root < 0)
                stat_xattr(fname, &buf);
  #ifdef SUPPORT_XATTRS
        if (am_root < 0)
                stat_xattr(fname, &buf);
-@@ -158,19 +180,11 @@ static void list_file(const char *fname)
+@@ -159,19 +181,11 @@ static void list_file(const char *fname)
  
        permstring(permbuf, buf.st_mode);
  
  
        permstring(permbuf, buf.st_mode);
  
@@ -624,10 +603,10 @@ diff --git a/tls.c b/tls.c
  
        /* TODO: Perhaps escape special characters in fname? */
  
  
        /* TODO: Perhaps escape special characters in fname? */
  
-@@ -181,13 +195,14 @@ static void list_file(const char *fname)
+@@ -182,13 +196,14 @@ static void list_file(const char *fname)
                    (long)minor(buf.st_rdev));
                    (long)minor(buf.st_rdev));
-       } else /* NB: use double for size since it might not fit in a long. */
-               printf("%12.0f", (double)buf.st_size);
+       } else
+               printf("%15s", do_big_num(buf.st_size, 1, NULL));
 -      printf(" %6ld.%-6ld %6ld %s %s%s\n",
 +      printf(" %6ld.%-6ld %6ld %s%s%s%s\n",
               (long)buf.st_uid, (long)buf.st_gid, (long)buf.st_nlink,
 -      printf(" %6ld.%-6ld %6ld %s %s%s\n",
 +      printf(" %6ld.%-6ld %6ld %s%s%s%s\n",
               (long)buf.st_uid, (long)buf.st_gid, (long)buf.st_nlink,
@@ -641,7 +620,7 @@ diff --git a/tls.c b/tls.c
    {"link-times",      'l', POPT_ARG_NONE,   &link_times, 0, 0, 0 },
    {"link-owner",      'L', POPT_ARG_NONE,   &link_owner, 0, 0, 0 },
  #ifdef SUPPORT_XATTRS
    {"link-times",      'l', POPT_ARG_NONE,   &link_times, 0, 0, 0 },
    {"link-owner",      'L', POPT_ARG_NONE,   &link_owner, 0, 0, 0 },
  #ifdef SUPPORT_XATTRS
-@@ -203,6 +218,7 @@ static void tls_usage(int ret)
+@@ -204,6 +219,7 @@ static void tls_usage(int ret)
    fprintf(F,"usage: " PROGRAM " [OPTIONS] FILE ...\n");
    fprintf(F,"Trivial file listing program for portably checking rsync\n");
    fprintf(F,"\nOptions:\n");
    fprintf(F,"usage: " PROGRAM " [OPTIONS] FILE ...\n");
    fprintf(F,"Trivial file listing program for portably checking rsync\n");
    fprintf(F,"\nOptions:\n");