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;
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);
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);
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;
#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));
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;
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) {
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));
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;
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;
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;
#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)
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. */
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,
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;
+ 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
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 */
+++ 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;
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';
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");
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 },
{"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';
--- 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;
#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;
--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).
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
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)
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).
+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];
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. */
}
--- 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);
}
{
#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) {
}
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];
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;