OBJS3=progress.o pipe.o
--- old/cleanup.c
+++ new/cleanup.c
-@@ -23,6 +23,7 @@
-
+@@ -27,6 +27,7 @@ extern int am_server;
+ extern int am_daemon;
extern int io_error;
extern int keep_partial;
+extern int am_generator;
extern int log_got_error;
extern char *partial_dir;
-
-@@ -149,8 +150,13 @@ void _exit_cleanup(int code, const char
+ extern char *logfile_name;
+@@ -154,8 +155,13 @@ void _exit_cleanup(int code, const char
code = RERR_PARTIAL;
}
-- if (code)
-+ if (code) {
+- if (code || am_daemon || (logfile_name && (am_server || !verbose)))
++ if (code || am_daemon || (logfile_name && (am_server || !verbose))) {
log_exit(code, file, line);
+#ifdef HAVE_LIBODBC
-+ db_log_exit(code,file,line);
++ db_log_exit(code, file, line);
+ db_log_close();
+#endif
+ }
am_sender ? "on" : "to",
--- old/configure.in
+++ new/configure.in
-@@ -540,6 +540,12 @@ if test x"$with_included_popt" != x"yes"
+@@ -577,6 +577,12 @@ if test x"$with_included_popt" != x"yes"
AC_CHECK_LIB(popt, poptGetContext, , [with_included_popt=yes])
fi
FN_LOCAL_BOOL(lp_list, list)
--- old/log.c
+++ new/log.c
-@@ -94,7 +94,7 @@ struct {
+@@ -91,7 +91,7 @@ struct {
/*
* Map from rsync error code to name, or return NULL.
*/
{
int i;
for (i = 0; rerr_names[i].name; i++) {
---- old/main.c
-+++ new/main.c
-@@ -168,6 +168,9 @@ static void handle_stats(int f)
-
- if (am_daemon) {
- log_exit(0, __FILE__, __LINE__);
-+#ifdef HAVE_LIBODBC
-+ db_log_exit(0,__FILE__,__LINE__);
-+#endif
- if (f == -1 || !am_sender)
- return;
- }
--- old/receiver.c
+++ new/receiver.c
-@@ -113,6 +113,10 @@ static int get_tmpname(char *fnametmp, c
+@@ -109,6 +109,10 @@ static int get_tmpname(char *fnametmp, c
if (maxname < 1) {
rprintf(FERROR, "temporary filename too long: %s\n", fname);
fnametmp[0] = '\0';
return 0;
}
-@@ -229,6 +233,11 @@ static int receive_data(int f_in, char *
+@@ -225,6 +229,11 @@ static int receive_data(int f_in, char *
rsyserr(FERROR, errno,
"lseek failed on %s",
full_fname(fname));
exit_cleanup(RERR_FILEIO);
}
continue;
-@@ -254,6 +263,9 @@ static int receive_data(int f_in, char *
+@@ -250,6 +259,9 @@ static int receive_data(int f_in, char *
report_write_error:
rsyserr(FERROR, errno, "write failed on %s",
full_fname(fname));
exit_cleanup(RERR_FILEIO);
}
-@@ -297,6 +309,12 @@ static void handle_delayed_updates(struc
+@@ -293,6 +305,12 @@ static void handle_delayed_updates(struc
rsyserr(FERROR, errno,
"rename failed for %s (from %s)",
full_fname(fname), partialptr);
} else {
if (remove_sent_files
|| (preserve_hard_links
-@@ -419,6 +437,9 @@ int recv_files(int f_in, struct file_lis
+@@ -414,6 +432,9 @@ int recv_files(int f_in, struct file_lis
if (server_filter_list.head
&& check_filter(&server_filter_list, fname, 0) < 0) {
rprintf(FERROR, "attempt to hack rsync failed.\n");
exit_cleanup(RERR_PROTOCOL);
}
-@@ -474,6 +495,11 @@ int recv_files(int f_in, struct file_lis
+@@ -469,6 +490,11 @@ int recv_files(int f_in, struct file_lis
rprintf(FERROR,
"invalid basis_dir index: %d.\n",
fnamecmp_type);
exit_cleanup(RERR_PROTOCOL);
}
pathjoin(fnamecmpbuf, sizeof fnamecmpbuf,
-@@ -519,6 +545,9 @@ int recv_files(int f_in, struct file_lis
+@@ -514,6 +540,9 @@ int recv_files(int f_in, struct file_lis
if (fd1 != -1 && do_fstat(fd1,&st) != 0) {
rsyserr(FERROR, errno, "fstat %s failed",
full_fname(fnamecmp));
discard_receive_data(f_in, file->length);
close(fd1);
continue;
-@@ -532,6 +561,9 @@ int recv_files(int f_in, struct file_lis
+@@ -527,6 +556,9 @@ int recv_files(int f_in, struct file_lis
*/
rprintf(FERROR,"recv_files: %s is a directory\n",
full_fname(fnamecmp));
discard_receive_data(f_in, file->length);
close(fd1);
continue;
-@@ -555,6 +587,9 @@ int recv_files(int f_in, struct file_lis
+@@ -550,6 +582,9 @@ int recv_files(int f_in, struct file_lis
if (fd2 == -1) {
rsyserr(FERROR, errno, "open %s failed",
full_fname(fname));
discard_receive_data(f_in, file->length);
if (fd1 != -1)
close(fd1);
-@@ -588,6 +623,10 @@ int recv_files(int f_in, struct file_lis
+@@ -583,6 +618,10 @@ int recv_files(int f_in, struct file_lis
if (fd2 == -1) {
rsyserr(FERROR, errno, "mkstemp %s failed",
full_fname(fnametmp));
discard_receive_data(f_in, file->length);
if (fd1 != -1)
close(fd1);
-@@ -610,12 +649,19 @@ int recv_files(int f_in, struct file_lis
+@@ -605,12 +644,19 @@ int recv_files(int f_in, struct file_lis
if (!log_before_transfer)
log_item(file, &initial_stats, iflags, NULL);
SIVAL(numbuf, 0, i);
--- old/sender.c
+++ new/sender.c
-@@ -352,6 +352,9 @@ void send_files(struct file_list *flist,
+@@ -354,6 +354,9 @@ void send_files(struct file_list *flist,
if (!log_before_transfer)
log_item(file, &initial_stats, iflags, NULL);
--- old/flist.c
+++ new/flist.c
-@@ -41,6 +41,7 @@ extern int curr_dir_depth;
+@@ -40,6 +40,7 @@ extern int filesfrom_fd;
extern int one_file_system;
extern int copy_dirlinks;
extern int keep_dirlinks;
extern int preserve_links;
extern int preserve_hard_links;
extern int preserve_devices;
-@@ -134,6 +135,8 @@ static void list_file_entry(struct file_
+@@ -133,6 +134,8 @@ static void list_file_entry(struct file_
permstring(permbuf, f->mode);
#ifdef SUPPORT_LINKS
if (preserve_links && S_ISLNK(f->mode)) {
rprintf(FINFO, "%s %11.0f %s %s -> %s\n",
-@@ -492,6 +495,9 @@ static struct file_struct *receive_file_
+@@ -491,6 +494,9 @@ static struct file_struct *receive_file_
char thisname[MAXPATHLEN];
unsigned int l1 = 0, l2 = 0;
int alloc_len, basename_len, dirname_len, linkname_len, sum_len;
OFF_T file_length;
char *basename, *dirname, *bp;
struct file_struct *file;
-@@ -595,13 +601,27 @@ static struct file_struct *receive_file_
+@@ -594,13 +600,27 @@ static struct file_struct *receive_file_
sum_len = always_checksum && S_ISREG(mode) ? MD4_SUM_LENGTH : 0;
file->modtime = modtime;
file->length = file_length;
-@@ -694,6 +714,11 @@ static struct file_struct *receive_file_
+@@ -693,6 +713,11 @@ static struct file_struct *receive_file_
read_buf(f, sum, checksum_len);
}
return file;
}
-@@ -943,6 +968,9 @@ static struct file_struct *send_file_nam
+@@ -942,6 +967,9 @@ static struct file_struct *send_file_nam
unsigned short flags)
{
struct file_struct *file;
file = make_file(fname, flist, stp, flags,
f == -2 ? SERVER_FILTERS : ALL_FILTERS);
-@@ -952,6 +980,15 @@ static struct file_struct *send_file_nam
+@@ -951,6 +979,15 @@ static struct file_struct *send_file_nam
if (chmod_modes && !S_ISLNK(file->mode))
file->mode = tweak_mode(file->mode, chmod_modes);
maybe_emit_filelist_progress(flist->count + flist_count_offset);
flist_expand(flist);
-@@ -959,6 +996,15 @@ static struct file_struct *send_file_nam
+@@ -958,6 +995,15 @@ static struct file_struct *send_file_nam
if (file->basename[0]) {
flist->files[flist->count++] = file;
send_file_entry(file, f);
+ itemize(file, ndx, 0, sxp, 0, 0, NULL);
+ }
if (verbose > 1 && maybe_ATTRS_REPORT) {
- code = daemon_log_format_has_i || dry_run
+ code = logfile_format_has_i || dry_run
? FCLIENT : FINFO;
@@ -688,8 +708,13 @@ static int try_dests_reg(struct file_str
}
+#endif
}
if (verbose > 1 && maybe_ATTRS_REPORT) {
- code = daemon_log_format_has_i || dry_run
+ code = logfile_format_has_i || dry_run
@@ -781,6 +819,7 @@ static int try_dests_non(struct file_str
}
+int sys_acl_free_qualifier(void *qual, SMB_ACL_TAG_T tagtype);
--- old/log.c
+++ new/log.c
-@@ -600,8 +600,10 @@ static void log_formatted(enum logcode c
+@@ -592,8 +592,10 @@ 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 preserve_perms = 0;
int preserve_executability = 0;
int preserve_devices = 0;
-@@ -194,6 +195,7 @@ static void print_rsync_version(enum log
+@@ -198,6 +199,7 @@ static void print_rsync_version(enum log
char const *got_socketpair = "no ";
char const *have_inplace = "no ";
char const *hardlinks = "no ";
char const *links = "no ";
char const *ipv6 = "no ";
STRUCT_STAT *dumstat;
-@@ -210,6 +212,10 @@ static void print_rsync_version(enum log
+@@ -214,6 +216,10 @@ static void print_rsync_version(enum log
hardlinks = "";
#endif
#ifdef SUPPORT_LINKS
links = "";
#endif
-@@ -223,9 +229,9 @@ static void print_rsync_version(enum log
+@@ -227,9 +233,9 @@ static void print_rsync_version(enum log
rprintf(f, "Copyright (C) 1996-2006 by Andrew Tridgell, Wayne Davison, and others.\n");
rprintf(f, "<http://rsync.samba.org/>\n");
rprintf(f, "Capabilities: %d-bit files, %ssocketpairs, "
/* Note that this field may not have type ino_t. It depends
* on the complicated interaction between largefile feature
-@@ -295,6 +301,9 @@ void usage(enum logcode F)
+@@ -299,6 +305,9 @@ void usage(enum logcode F)
rprintf(F," -H, --hard-links preserve hard links\n");
rprintf(F," -p, --perms preserve permissions\n");
rprintf(F," -E, --executability preserve the file's executability\n");
rprintf(F," --chmod=CHMOD change destination permissions\n");
rprintf(F," -o, --owner preserve owner (super-user only)\n");
rprintf(F," -g, --group preserve group\n");
-@@ -410,6 +419,9 @@ static struct poptOption long_options[]
+@@ -415,6 +424,9 @@ static struct poptOption long_options[]
{"no-perms", 0, POPT_ARG_VAL, &preserve_perms, 0, 0, 0 },
{"no-p", 0, POPT_ARG_VAL, &preserve_perms, 0, 0, 0 },
{"executability", 'E', POPT_ARG_NONE, &preserve_executability, 0, 0, 0 },
{"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 },
-@@ -1072,6 +1084,24 @@ int parse_arguments(int *argc, const cha
+@@ -1080,6 +1092,24 @@ int parse_arguments(int *argc, const cha
usage(FINFO);
exit_cleanup(0);
default:
/* A large opt value means that set_refuse_options()
* turned this option off. */
-@@ -1503,6 +1533,10 @@ void server_options(char **args,int *arg
+@@ -1526,6 +1556,10 @@ void server_options(char **args,int *arg
if (preserve_hard_links)
argstr[x++] = 'H';
if (preserve_gid)
--- old/receiver.c
+++ new/receiver.c
-@@ -48,6 +48,7 @@ extern int keep_partial;
+@@ -47,6 +47,7 @@ extern int keep_partial;
extern int checksum_seed;
extern int inplace;
extern int delay_updates;
extern struct stats stats;
extern char *log_format;
extern char *tmpdir;
-@@ -346,6 +347,10 @@ int recv_files(int f_in, struct file_lis
- int itemizing = am_daemon ? daemon_log_format_has_i
- : !am_server && log_format_has_i;
+@@ -344,6 +345,10 @@ int recv_files(int f_in, struct file_lis
+ int save_make_backups = make_backups;
+ int itemizing = am_server ? logfile_format_has_i : log_format_has_i;
int max_phase = protocol_version >= 29 ? 2 : 1;
+ int dflt_perms = (ACCESSPERMS & ~orig_umask);
+#ifdef SUPPORT_ACLS
int i, recv_ok;
if (verbose > 2)
-@@ -543,7 +548,16 @@ int recv_files(int f_in, struct file_lis
+@@ -541,7 +546,16 @@ int recv_files(int f_in, struct file_lis
* mode based on the local permissions and some heuristics. */
if (!preserve_perms) {
int exists = fd1 != -1;
@@ -33,6 +33,7 @@
extern int verbose;
extern int dry_run;
- extern int daemon_log_format_has_i;
+ extern int logfile_format_has_i;
+extern int preserve_acls;
extern int preserve_perms;
extern int preserve_executability;
--- old/rsync.h
+++ new/rsync.h
-@@ -485,6 +485,15 @@ struct idev {
+@@ -486,6 +486,15 @@ struct idev {
#define IN_LOOPBACKNET 127
#endif
#define GID_NONE ((gid_t)-1)
#define HL_CHECK_MASTER 0
-@@ -645,6 +654,17 @@ struct stats {
+@@ -646,6 +655,17 @@ struct stats {
struct chmod_mode_struct;
#include "byteorder.h"
#include "lib/mdfour.h"
#include "lib/wildmatch.h"
-@@ -660,6 +680,16 @@ struct chmod_mode_struct;
+@@ -661,6 +681,16 @@ struct chmod_mode_struct;
#define UNUSED(x) x __attribute__((__unused__))
--chmod=CHMOD change destination permissions
-o, --owner preserve owner (super-user only)
-g, --group preserve group
-@@ -742,7 +743,9 @@ quote(itemize(
+@@ -744,7 +745,9 @@ quote(itemize(
permissions, though the bf(--executability) option might change just
the execute permission for the file.
it() New files get their "normal" permission bits set to the source
their special permission bits disabled except in the case where a new
directory inherits a setgid bit from its parent directory.
))
-@@ -773,9 +776,11 @@ The preservation of the destination's se
+@@ -775,9 +778,11 @@ The preservation of the destination's se
directories when bf(--perms) is off was added in rsync 2.6.7. Older rsync
versions erroneously preserved the three special permission bits for
newly-created files when bf(--perms) was off, while overriding the
dit(bf(-E, --executability)) This option causes rsync to preserve the
executability (or non-executability) of regular files when bf(--perms) is
-@@ -793,6 +798,15 @@ quote(itemize(
+@@ -795,6 +800,15 @@ quote(itemize(
If bf(--perms) is enabled, this option is ignored.
dit(bf(--chmod)) This option tells rsync to apply one or more
comma-separated "chmod" strings to the permission of the files in the
transfer. The resulting value is treated as though it was the permissions
-@@ -1374,8 +1388,8 @@ if the receiving rsync is at least versi
+@@ -1376,8 +1390,8 @@ if the receiving rsync is at least versi
with older versions of rsync, but that also turns on the output of other
verbose messages).
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.
-@@ -1424,7 +1438,11 @@ quote(itemize(
+@@ -1426,7 +1440,11 @@ 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 struct file_list *the_file_list;
extern char curr_dir[MAXPATHLEN];
-@@ -355,14 +356,14 @@ static void send_file_entry(struct file_
+@@ -347,14 +348,14 @@ static void send_file_entry(struct file_
}
} else if (protocol_version < 28)
rdev = makedev(0, 0);
if (file->modtime == modtime)
flags |= XMIT_SAME_TIME;
else
-@@ -613,8 +614,7 @@ static struct file_struct *receive_file_
+@@ -605,8 +606,7 @@ static struct file_struct *receive_file_
file->modtime = modtime;
file->length = file_length;
file->mode = mode;
if (dirname_len) {
file->dirname = lastdir = bp;
-@@ -865,8 +865,7 @@ struct file_struct *make_file(char *fnam
+@@ -855,8 +855,7 @@ struct file_struct *make_file(char *fnam
file->modtime = st.st_mtime;
file->length = st.st_size;
file->mode = st.st_mode;
#ifdef SUPPORT_HARD_LINKS
if (flist && flist->hlink_pool) {
-@@ -934,8 +933,7 @@ struct file_struct *make_file(char *fnam
+@@ -924,8 +923,7 @@ struct file_struct *make_file(char *fnam
file->modtime = st2.st_mtime;
file->length = st2.st_size;
file->mode = st2.st_mode;
file->u.link = NULL;
} else
file->mode = save_mode;
-@@ -1379,7 +1377,7 @@ struct file_list *recv_file_list(int f)
+@@ -1375,7 +1373,7 @@ struct file_list *recv_file_list(int f)
clean_flist(flist, relative_paths, 1);
if (f >= 0) {
/* Recv the io_error flag */
if (lp_ignore_errors(module_id) || ignore_errors)
-@@ -1695,13 +1693,15 @@ static void output_flist(struct file_lis
+@@ -1691,13 +1689,15 @@ static void output_flist(struct file_lis
for (i = 0; i < flist->count; i++) {
file = flist->files[i];
iflags |= ITEM_IS_NEW;
--- old/log.c
+++ new/log.c
-@@ -43,6 +43,7 @@ extern int daemon_log_format_has_o_or_i;
- extern mode_t orig_umask;
- extern char *auth_user;
+@@ -45,6 +45,7 @@ extern char *auth_user;
extern char *log_format;
+ extern char *logfile_format;
+ extern char *logfile_name;
+extern struct id_pair *id_pairs;
#if defined HAVE_ICONV_OPEN && defined HAVE_ICONV_H
extern iconv_t ic_chck;
#endif
-@@ -475,16 +476,16 @@ static void log_formatted(enum logcode c
+@@ -464,16 +465,16 @@ static void log_formatted(enum logcode c
case 'U':
strlcat(fmt, "ld", sizeof fmt);
snprintf(buf2, sizeof buf2, fmt,
rsyserr(FERROR, errno, "%s %s failed",
--- old/rsync.h
+++ new/rsync.h
-@@ -495,6 +495,11 @@ struct hlink {
+@@ -496,6 +496,11 @@ struct hlink {
int hlindex;
};
#define F_DEV link_u.idev->dev
#define F_INODE link_u.idev->inode
-@@ -519,8 +524,7 @@ struct file_struct {
+@@ -520,8 +525,7 @@ struct file_struct {
struct hlink *links;
} link_u;
time_t modtime;
extern int size_only;
extern OFF_T max_size;
extern OFF_T min_size;
-@@ -379,7 +380,7 @@ void itemize(struct file_struct *file, i
+@@ -376,7 +377,7 @@ void itemize(struct file_struct *file, i
/* Perform our quick-check heuristic for determining if a file is unchanged. */
int unchanged_file(char *fn, struct file_struct *file, STRUCT_STAT *st)
{
/* if always checksum is set then we use the checksum instead
--- old/main.c
+++ new/main.c
-@@ -110,7 +110,7 @@ pid_t wait_process(pid_t pid, int *statu
+@@ -119,7 +119,7 @@ pid_t wait_process(pid_t pid, int *statu
}
/* Wait for a process to exit, calling io_flush while waiting. */
int daemon_bwlimit = 0;
int bwlimit = 0;
int fuzzy_basis = 0;
-@@ -148,6 +149,8 @@ char *basis_dir[MAX_BASIS_DIRS+1];
- char *config_file = NULL;
- char *shell_cmd = NULL;
- char *log_format = NULL;
+@@ -151,6 +152,8 @@ char *log_format = NULL;
+ char *logfile_name = NULL;
+ char *logfile_format = NULL;
+ char *password_file = NULL;
+char *source_filter = NULL;
+char *dest_filter = NULL;
- char *password_file = NULL;
char *rsync_path = RSYNC_PATH;
char *backup_dir = NULL;
-@@ -332,6 +335,7 @@ void usage(enum logcode F)
+ char backup_dir_buf[MAXPATHLEN];
+@@ -337,6 +340,7 @@ void usage(enum logcode F)
rprintf(F," --timeout=TIME set I/O timeout in seconds\n");
rprintf(F," -I, --ignore-times don't skip files that match in size and mod-time\n");
rprintf(F," --size-only skip files that match in size\n");
rprintf(F," --modify-window=NUM compare mod-times with reduced accuracy\n");
rprintf(F," -T, --temp-dir=DIR create temporary files in directory DIR\n");
rprintf(F," -y, --fuzzy find similar file for basis if no dest file\n");
-@@ -367,6 +371,8 @@ void usage(enum logcode F)
+@@ -373,6 +377,8 @@ void usage(enum logcode F)
rprintf(F," --write-batch=FILE write a batched update to FILE\n");
rprintf(F," --only-write-batch=FILE like --write-batch but w/o updating destination\n");
rprintf(F," --read-batch=FILE read a batched update from FILE\n");
rprintf(F," --protocol=NUM force an older protocol version to be used\n");
#ifdef INET6
rprintf(F," -4, --ipv4 prefer IPv4\n");
-@@ -443,6 +449,7 @@ static struct poptOption long_options[]
+@@ -453,6 +459,7 @@ static struct poptOption long_options[]
{"chmod", 0, POPT_ARG_STRING, 0, OPT_CHMOD, 0, 0 },
{"ignore-times", 'I', POPT_ARG_NONE, &ignore_times, 0, 0, 0 },
{"size-only", 0, POPT_ARG_NONE, &size_only, 0, 0, 0 },
{"one-file-system", 'x', POPT_ARG_NONE, 0, 'x', 0, 0 },
{"update", 'u', POPT_ARG_NONE, &update_only, 0, 0, 0 },
{"existing", 0, POPT_ARG_NONE, &ignore_non_existing, 0, 0, 0 },
-@@ -517,6 +524,8 @@ static struct poptOption long_options[]
+@@ -528,6 +535,8 @@ static struct poptOption long_options[]
{"password-file", 0, POPT_ARG_STRING, &password_file, 0, 0, 0 },
{"blocking-io", 0, POPT_ARG_VAL, &blocking_io, 1, 0, 0 },
{"no-blocking-io", 0, POPT_ARG_VAL, &blocking_io, 0, 0, 0 },
{"protocol", 0, POPT_ARG_INT, &protocol_version, 0, 0, 0 },
{"checksum-seed", 0, POPT_ARG_INT, &checksum_seed, 0, 0, 0 },
{"server", 0, POPT_ARG_NONE, 0, OPT_SERVER, 0, 0 },
-@@ -1385,6 +1394,16 @@ int parse_arguments(int *argc, const cha
+@@ -1406,6 +1415,16 @@ int parse_arguments(int *argc, const cha
}
}
if (files_from) {
char *h, *p;
int q;
-@@ -1647,6 +1666,25 @@ void server_options(char **args,int *arg
+@@ -1671,6 +1690,25 @@ void server_options(char **args,int *arg
args[ac++] = "--size-only";
}
goto oom;
--- old/pipe.c
+++ new/pipe.c
-@@ -157,3 +157,77 @@ pid_t local_child(int argc, char **argv,
+@@ -159,3 +159,77 @@ pid_t local_child(int argc, char **argv,
return pid;
}
+}
--- old/receiver.c
+++ new/receiver.c
-@@ -53,6 +53,7 @@ extern int inplace;
+@@ -49,6 +49,7 @@ extern int inplace;
extern int delay_updates;
extern struct stats stats;
extern char *log_format;
extern char *tmpdir;
extern char *partial_dir;
extern char *basis_dir[];
-@@ -350,6 +351,8 @@ int recv_files(int f_in, struct file_lis
- : !am_server && log_format_has_i;
+@@ -345,6 +346,8 @@ int recv_files(int f_in, struct file_lis
+ int itemizing = am_server ? logfile_format_has_i : log_format_has_i;
int max_phase = protocol_version >= 29 ? 2 : 1;
int i, recv_ok;
+ pid_t pid = 0;
if (verbose > 2)
rprintf(FINFO,"recv_files(%d) starting\n",flist->count);
-@@ -362,6 +365,23 @@ int recv_files(int f_in, struct file_lis
+@@ -357,6 +360,23 @@ int recv_files(int f_in, struct file_lis
if (delay_updates)
delayed_bits = bitbag_create(flist->count);
while (1) {
cleanup_disable();
-@@ -604,6 +624,9 @@ int recv_files(int f_in, struct file_lis
+@@ -599,6 +619,9 @@ int recv_files(int f_in, struct file_lis
else if (!am_server && verbose && do_progress)
rprintf(FINFO, "%s\n", fname);
/* recv file data */
recv_ok = receive_data(f_in, fnamecmp, fd1, st.st_size,
fname, fd2, file->length);
-@@ -619,6 +642,16 @@ int recv_files(int f_in, struct file_lis
+@@ -614,6 +637,16 @@ int recv_files(int f_in, struct file_lis
exit_cleanup(RERR_FILEIO);
}
+ }
+
if ((recv_ok && (!delay_updates || !partialptr)) || inplace) {
- if (partialptr == fname || *partial_dir == '/')
- partialptr = NULL;
+ char *temp_copy_name;
+ if (partialptr == fname)
--- old/rsync.h
+++ new/rsync.h
@@ -103,6 +103,7 @@
--- old/rsync.yo
+++ new/rsync.yo
-@@ -355,6 +355,7 @@ to the detailed description below for a
+@@ -359,6 +359,7 @@ to the detailed description below for a
--timeout=TIME set I/O timeout in seconds
-I, --ignore-times don't skip files that match size and time
--size-only skip files that match in size
--modify-window=NUM compare mod-times with reduced accuracy
-T, --temp-dir=DIR create temporary files in directory DIR
-y, --fuzzy find similar file for basis if no dest file
-@@ -390,6 +391,8 @@ to the detailed description below for a
+@@ -395,6 +396,8 @@ to the detailed description below for a
--write-batch=FILE write a batched update to FILE
--only-write-batch=FILE like --write-batch but w/o updating dest
--read-batch=FILE read a batched update from FILE
--protocol=NUM force an older protocol version to be used
--checksum-seed=NUM set block/file checksum seed (advanced)
-4, --ipv4 prefer IPv4
-@@ -1609,6 +1612,33 @@ file previously generated by bf(--write-
+@@ -1732,6 +1735,33 @@ file previously generated by bf(--write-
If em(FILE) is bf(-), the batch data will be read from standard input.
See the "BATCH MODE" section for details.
version of rsync. For instance, if rsync 2.6.4 is being used with the
--- old/sender.c
+++ new/sender.c
-@@ -41,6 +41,7 @@ extern int write_batch;
+@@ -44,6 +44,7 @@ extern int write_batch;
extern struct stats stats;
extern struct file_list *the_file_list;
extern char *log_format;
/**
-@@ -219,6 +220,26 @@ void send_files(struct file_list *flist,
- : !am_server && log_format_has_i;
+@@ -221,6 +222,26 @@ void send_files(struct file_list *flist,
+ int itemizing = am_server ? logfile_format_has_i : log_format_has_i;
int f_xfer = write_batch < 0 ? batch_fd : f_out;
int i, j;
+ char *filter_argv[MAX_FILTER_ARGS + 1];
if (verbose > 2)
rprintf(FINFO, "send_files starting\n");
-@@ -293,6 +314,7 @@ void send_files(struct file_list *flist,
+@@ -295,6 +316,7 @@ void send_files(struct file_list *flist,
return;
}
fd = do_open(fname, O_RDONLY, 0);
if (fd == -1) {
if (errno == ENOENT) {
-@@ -321,6 +343,33 @@ void send_files(struct file_list *flist,
+@@ -323,6 +345,33 @@ void send_files(struct file_list *flist,
return;
}
if (st.st_size) {
int32 read_size = MAX(s->blength * 3, MAX_MAP_SIZE);
mbuf = map_file(fd, st.st_size, read_size, s->blength);
-@@ -363,6 +412,8 @@ void send_files(struct file_list *flist,
+@@ -365,6 +414,8 @@ void send_files(struct file_list *flist,
}
}
close(fd);