extern int protocol_version;
extern int fuzzy_basis;
extern int always_checksum;
-@@ -98,6 +97,11 @@ static int deletion_count = 0; /* used t
+@@ -97,6 +96,11 @@ static int deletion_count = 0; /* used t
static int can_link_symlinks = 1; /* start out optimistic */
static int can_link_devices = 1;
/* For calling delete_file() */
#define DEL_FORCE_RECURSE (1<<1) /* recurse even w/o --force */
#define DEL_TERSE (1<<3)
-@@ -446,8 +450,8 @@ static void sum_sizes_sqroot(struct sum_
+@@ -445,8 +449,8 @@ static void sum_sizes_sqroot(struct sum_
}
if (protocol_version < 27) {
s2length = SUM_LENGTH;
} else {
int32 c;
-@@ -457,7 +461,7 @@ static void sum_sizes_sqroot(struct sum_
+@@ -456,7 +460,7 @@ static void sum_sizes_sqroot(struct sum_
for (c = blength; c >>= 1 && b; b--) {}
/* add a bit, subtract rollsum, round up. */
s2length = (b + 1 - 32 + 7) / 8; /* --optimize in compiler-- */
s2length = MIN(s2length, SUM_LENGTH);
}
-@@ -491,7 +495,7 @@ static void generate_and_send_sums(int f
+@@ -490,7 +494,7 @@ static void generate_and_send_sums(int f
sum_sizes_sqroot(&sum, len);
write_sum_head(f_out, &sum);
return;
if (len > 0)
-@@ -510,7 +514,7 @@ static void generate_and_send_sums(int f
+@@ -509,7 +513,7 @@ static void generate_and_send_sums(int f
if (f_copy >= 0) {
full_write(f_copy, map, n1);
continue;
}
-@@ -1140,7 +1144,7 @@ static void recv_generator(char *fname,
+@@ -1152,7 +1156,7 @@ static void recv_generator(char *fname,
return;
}
return;
if (fnamecmp_type <= FNAMECMP_BASIS_DIR_HIGH)
-@@ -1195,7 +1199,7 @@ static void recv_generator(char *fname,
+@@ -1207,7 +1211,7 @@ static void recv_generator(char *fname,
goto notify_others;
}
if (!(backupptr = get_backup_name(fname))) {
close(fd);
return;
-@@ -1286,7 +1290,10 @@ void generate_files(int f_out, struct fi
+@@ -1298,9 +1302,12 @@ void generate_files(int f_out, struct fi
int save_ignore_existing = ignore_existing;
int save_ignore_non_existing = ignore_non_existing;
int save_do_progress = do_progress;
- int save_make_backups = make_backups;
+ int save_make_backups = GEN_make_backups = make_backups;
-+
+ int dir_tweaking = !(list_only || local_name || dry_run);
+
+ GEN_append_mode = append_mode;
+ GEN_csum_length = csum_length;
-
++
if (protocol_version >= 29) {
itemizing = 1;
-@@ -1315,7 +1322,7 @@ void generate_files(int f_out, struct fi
+ maybe_ATTRS_REPORT = log_format_has_i ? 0 : ATTRS_REPORT;
+@@ -1328,7 +1335,7 @@ void generate_files(int f_out, struct fi
do_delete_pass(flist);
do_progress = 0;
whole_file = 0;
if (verbose >= 2) {
rprintf(FINFO, "delta-transmission %s\n",
-@@ -1324,12 +1331,6 @@ void generate_files(int f_out, struct fi
+@@ -1337,12 +1344,6 @@ void generate_files(int f_out, struct fi
: "enabled");
}
for (i = 0; i < flist->count; i++) {
struct file_struct *file = flist->files[i];
-@@ -1373,23 +1374,34 @@ void generate_files(int f_out, struct fi
+@@ -1386,23 +1387,34 @@ void generate_files(int f_out, struct fi
delete_in_dir(NULL, NULL, NULL, NULL);
phase++;
if (local_name)
strlcpy(fbuf, local_name, sizeof fbuf);
else
-@@ -1401,27 +1413,43 @@ void generate_files(int f_out, struct fi
+@@ -1414,27 +1426,43 @@ void generate_files(int f_out, struct fi
phase++;
ignore_non_existing = save_ignore_non_existing;
ignore_existing = save_ignore_existing;
do_progress = save_do_progress;
--- old/io.c
+++ new/io.c
-@@ -47,20 +47,17 @@ extern int allowed_lull;
+@@ -46,20 +46,17 @@ extern int allowed_lull;
extern int am_server;
extern int am_daemon;
extern int am_sender;
int batch_fd = -1;
int batch_gen_fd = -1;
-@@ -84,7 +81,6 @@ const char *io_read_phase = phase_unknow
+@@ -83,7 +80,6 @@ const char *io_read_phase = phase_unknow
int kluge_around_eof = 0;
int msg_fd_in = -1;
int sock_f_in = -1;
int sock_f_out = -1;
-@@ -111,27 +107,32 @@ static OFF_T active_bytecnt = 0;
+@@ -110,27 +106,31 @@ static OFF_T active_bytecnt = 0;
static void read_loop(int fd, char *buf, size_t len);
struct flist_ndx_item {
struct msg_list_item {
- struct msg_list_item *next;
+ volatile struct msg_list_item *next;
-+ pthread_mutex_t mutex;
- char *buf;
int len;
+ enum msgcode code;
+ char buf[1];
};
struct msg_list {
+ pthread_mutex_t mutex;
};
--static struct msg_list msg_list;
+-static struct msg_list msg2genr, msg2sndr;
+static struct msg_list msg_list = { NULL, NULL, PTHREAD_MUTEX_INITIALIZER };
static void flist_ndx_push(struct flist_ndx_list *lp, int ndx)
{
-@@ -141,27 +142,31 @@ static void flist_ndx_push(struct flist_
+@@ -140,27 +140,31 @@ static void flist_ndx_push(struct flist_
out_of_memory("flist_ndx_push");
item->next = NULL;
item->ndx = ndx;
return ndx;
}
-@@ -170,7 +175,7 @@ static void check_timeout(void)
+@@ -169,7 +173,7 @@ static void check_timeout(void)
{
time_t t;
return;
if (!last_io_in) {
-@@ -211,45 +216,40 @@ void set_io_timeout(int secs)
+@@ -210,44 +214,38 @@ void set_io_timeout(int secs)
/* Setup the fd used to receive MSG_* messages. Only needed during the
* early stages of being a local sender (up through the sending of the
-}
-
/* Add a message to the pending MSG_* list. */
- static void msg_list_add(int code, char *buf, int len)
+-static void msg_list_add(struct msg_list *lst, int code, char *buf, int len)
++static void msg_list_add(int code, char *buf, int len)
{
- struct msg_list_item *ml;
+ struct msg_list_item *m;
+- int sz = len + 4 + sizeof m[0] - 1;
++ int sz = len + sizeof m[0] - 1;
+ assert(am_receiver());
- if (!(ml = new(struct msg_list_item)))
- out_of_memory("msg_list_add");
- ml->next = NULL;
-- if (!(ml->buf = new_array(char, len+4)))
-+ /* NOTE: the "+ 1" allows rwrite() to use the buf! */
-+ if (!(ml->buf = new_array(char, len + 1)))
+ if (!(m = (struct msg_list_item *)new_array(char, sz)))
out_of_memory("msg_list_add");
-- SIVAL(ml->buf, 0, ((code+MPLEX_BASE)<<24) | len);
-- memcpy(ml->buf+4, buf, len);
-- ml->len = len+4;
-+ memcpy(ml->buf, buf, len);
-+ ml->len = len;
-+ ml->code = code;
+ m->next = NULL;
+- m->len = len + 4;
+- SIVAL(m->buf, 0, ((code+MPLEX_BASE)<<24) | len);
+- memcpy(m->buf + 4, buf, len);
+- if (lst->tail)
+- lst->tail->next = m;
++ m->len = len;
++ m->code = code;
++ memcpy(m->buf, buf, len);
+
+ pthread_mutex_lock(&msg_list.mutex);
- if (msg_list.tail)
- msg_list.tail->next = ml;
++ if (msg_list.tail)
++ msg_list.tail->next = m;
else
- msg_list.head = ml;
- msg_list.tail = ml;
+- lst->head = m;
+- lst->tail = m;
++ msg_list.head = m;
++ msg_list.tail = m;
+ pthread_mutex_unlock(&msg_list.mutex);
}
static void read_msg_fd(void)
{
char buf[2048];
-@@ -268,51 +268,6 @@ static void read_msg_fd(void)
+@@ -266,57 +264,6 @@ static void read_msg_fd(void)
tag = (tag >> 24) - MPLEX_BASE;
switch (tag) {
- exit_cleanup(RERR_STREAMIO);
- }
- read_loop(fd, buf, len);
-- io_multiplex_write(MSG_DELETED, buf, len);
+- if (defer_forwarding_messages)
+- msg_list_add(&msg2sndr, MSG_DELETED, buf, len);
+- else
+- io_multiplex_write(MSG_DELETED, buf, len);
- break;
- case MSG_SUCCESS:
- if (len != 4 || !am_generator) {
- read_loop(fd, buf, len);
- if (remove_sent_files) {
- decrement_active_files(IVAL(buf,0));
-- io_multiplex_write(MSG_SUCCESS, buf, len);
+- if (defer_forwarding_messages)
+- msg_list_add(&msg2sndr, MSG_SUCCESS, buf, len);
+- else
+- io_multiplex_write(MSG_SUCCESS, buf, len);
- }
- if (preserve_hard_links)
- flist_ndx_push(&hlink_list, IVAL(buf,0));
case MSG_INFO:
case MSG_ERROR:
case MSG_LOG:
-@@ -355,71 +310,75 @@ void decrement_active_files(int ndx)
+@@ -325,10 +272,7 @@ static void read_msg_fd(void)
+ if (n >= sizeof buf)
+ n = sizeof buf - 1;
+ read_loop(fd, buf, n);
+- if (am_generator && am_server && defer_forwarding_messages)
+- msg_list_add(&msg2sndr, tag, buf, n);
+- else
+- rwrite((enum logcode)tag, buf, n);
++ rwrite((enum logcode)tag, buf, n);
+ len -= n;
+ }
+ break;
+@@ -362,70 +306,76 @@ void decrement_active_files(int ndx)
active_bytecnt -= the_file_list->files[ndx]->length;
}
+/* Try to pop messages off the list onto the wire. If we leave with more
* to do, return 0. On error, return -1. If everything flushed, return 1.
- * This is only active in the receiver. */
+-static int msg2genr_flush(int flush_it_all)
+ * This is only called by the generator. */
- static int msg_list_flush(int flush_it_all)
++static void msg_list_flush(void)
{
- static int written = 0;
- struct timeval tv;
- fd_set fds;
--
++ assert(am_generator());
+
- if (msg_fd_out < 0)
- return -1;
--
-+ assert(am_generator());
-+ no_flush++;
- while (msg_list.head) {
-- struct msg_list_item *ml = msg_list.head;
-- int n = write(msg_fd_out, ml->buf + written, ml->len - written);
++ if (defer_forwarding_messages)
++ return;
+
+- while (msg2genr.head) {
+- struct msg_list_item *m = msg2genr.head;
+- int n = write(msg_fd_out, m->buf + written, m->len - written);
- if (n < 0) {
- if (errno == EINTR)
- continue;
- tv.tv_usec = 0;
- if (!select(msg_fd_out+1, NULL, &fds, NULL, &tv))
- check_timeout();
-- } else if ((written += n) == ml->len) {
-- free(ml->buf);
-- msg_list.head = ml->next;
-- if (!msg_list.head)
-- msg_list.tail = NULL;
-- free(ml);
+- } else if ((written += n) == m->len) {
+- msg2genr.head = m->next;
+- if (!msg2genr.head)
+- msg2genr.tail = NULL;
+- free(m);
- written = 0;
-+ struct msg_list_item *ml = (struct msg_list_item *)msg_list.head;
-+ switch (ml->code) {
++ no_flush++;
++ defer_forwarding_messages = 1;
++ while (msg_list.head) {
++ struct msg_list_item *m = (struct msg_list_item *)msg_list.head;
++ pthread_mutex_lock(&msg_list.mutex);
++ if (!(msg_list.head = m->next))
++ msg_list.tail = NULL;
++ pthread_mutex_unlock(&msg_list.mutex);
++ switch (m->code) {
+ case MSG_SOCKERR:
+ close_multiplexing_out();
+ /* FALL THROUGH */
+ case MSG_INFO:
+ case MSG_ERROR:
+ case MSG_LOG:
-+ rwrite(ml->code, ml->buf, ml->len);
++ rwrite(m->code, m->buf, m->len);
+ break;
+ default:
-+ io_multiplex_write(ml->code, ml->buf, ml->len);
++ io_multiplex_write(m->code, m->buf, m->len);
+ break;
}
-+ pthread_mutex_lock(&msg_list.mutex);
-+ if (!(msg_list.head = ml->next))
-+ msg_list.tail = NULL;
-+ pthread_mutex_unlock(&msg_list.mutex);
-+ free(ml->buf);
-+ free(ml);
-+ if (!flush_it_all)
-+ break;
++ free(m);
}
+- return 1;
++ defer_forwarding_messages = 0;
+ no_flush--;
-+
- return 1;
}
void send_msg(enum msgcode code, char *buf, int len)
io_multiplex_write(code, buf, len);
- return;
- }
-- msg_list_add(code, buf, len);
-- msg_list_flush(NORMAL_FLUSH);
+- msg_list_add(&msg2genr, code, buf, len);
+- msg2genr_flush(NORMAL_FLUSH);
}
-int get_redo_num(int itemizing, enum logcode code)
return flist_ndx_pop(&hlink_list);
}
-@@ -499,11 +458,6 @@ static int read_timeout(int fd, char *bu
+@@ -505,11 +455,6 @@ static int read_timeout(int fd, char *bu
FD_ZERO(&r_fds);
FD_ZERO(&w_fds);
FD_SET(fd, &r_fds);
-- if (msg_list.head) {
+- if (msg2genr.head) {
- FD_SET(msg_fd_out, &w_fds);
- if (msg_fd_out > maxfd)
- maxfd = msg_fd_out;
if (io_filesfrom_f_out >= 0) {
int new_fd;
if (io_filesfrom_buflen == 0) {
-@@ -536,9 +490,6 @@ static int read_timeout(int fd, char *bu
+@@ -542,9 +487,6 @@ static int read_timeout(int fd, char *bu
continue;
}
-- if (msg_list.head && FD_ISSET(msg_fd_out, &w_fds))
-- msg_list_flush(NORMAL_FLUSH);
+- if (msg2genr.head && FD_ISSET(msg_fd_out, &w_fds))
+- msg2genr_flush(NORMAL_FLUSH);
-
if (io_filesfrom_f_out >= 0) {
if (io_filesfrom_buflen) {
if (FD_ISSET(io_filesfrom_f_out, &w_fds)) {
-@@ -860,6 +811,8 @@ static void readfd(int fd, char *buffer,
+@@ -866,6 +808,8 @@ static void readfd(int fd, char *buffer,
}
if (fd == write_batch_monitor_in) {
if ((size_t)write(batch_fd, buffer, total) != total)
exit_cleanup(RERR_FILEIO);
}
-@@ -1115,7 +1068,6 @@ static void writefd_unbuffered(int fd,ch
+@@ -1127,7 +1071,6 @@ static void writefd_unbuffered(int fd,ch
* to grab any messages they sent before they died. */
while (fd == sock_f_out && io_multiplexing_in) {
set_io_timeout(30);
readfd_unbuffered(sock_f_in, io_filesfrom_buf,
sizeof io_filesfrom_buf);
}
-@@ -1125,7 +1077,7 @@ static void writefd_unbuffered(int fd,ch
- total += cnt;
+@@ -1138,7 +1081,7 @@ static void writefd_unbuffered(int fd,ch
+ defer_forwarding_messages = 1;
if (fd == sock_f_out) {
- if (io_timeout || am_generator)
last_io_out = time(NULL);
sleep_for_bwlimit(cnt);
}
-@@ -1149,7 +1101,7 @@ static void mplex_write(enum msgcode cod
- * cause output to occur down the socket. Setting contiguous_write_len
- * prevents the reading of msg_fd_in once we actually start to write
- * this sequence of data (though we might read it before the start). */
-- if (am_generator && msg_fd_in >= 0)
-+ if (am_generator() && msg_fd_in >= 0)
- contiguous_write_len = len + 4;
-
- if (n > sizeof buffer - 4)
-@@ -1165,31 +1117,29 @@ static void mplex_write(enum msgcode cod
- if (len)
- writefd_unbuffered(sock_f_out, buf, len);
+@@ -1148,23 +1091,6 @@ static void writefd_unbuffered(int fd,ch
+ no_flush--;
+ }
-- if (am_generator && msg_fd_in >= 0)
-+ if (am_generator() && msg_fd_in >= 0)
- contiguous_write_len = 0;
+-static void msg2sndr_flush(void)
+-{
+- if (defer_forwarding_messages)
+- return;
+-
+- while (msg2sndr.head && io_multiplexing_out) {
+- struct msg_list_item *m = msg2sndr.head;
+- if (!(msg2sndr.head = m->next))
+- msg2sndr.tail = NULL;
+- stats.total_written += m->len;
+- defer_forwarding_messages = 1;
+- writefd_unbuffered(sock_f_out, m->buf, m->len);
+- defer_forwarding_messages = 0;
+- free(m);
+- }
+-}
+-
+ /**
+ * Write an message to a multiplexed stream. If this fails then rsync
+ * exits.
+@@ -1190,14 +1116,15 @@ static void mplex_write(enum msgcode cod
+ defer_forwarding_messages = 1;
+ writefd_unbuffered(sock_f_out, buf, len);
+ defer_forwarding_messages = 0;
+- msg2sndr_flush();
++ if (am_generator())
++ msg_list_flush();
+ }
}
void io_flush(int flush_it_all)
{
-- msg_list_flush(flush_it_all);
--
-- if (!iobuf_out_cnt || no_flush)
-+ if (no_flush)
- return;
-
-- if (io_multiplexing_out)
-- mplex_write(MSG_DATA, iobuf_out, iobuf_out_cnt);
-- else
-- writefd_unbuffered(sock_f_out, iobuf_out, iobuf_out_cnt);
-- iobuf_out_cnt = 0;
-+ if (iobuf_out_cnt) {
-+ if (io_multiplexing_out)
-+ mplex_write(MSG_DATA, iobuf_out, iobuf_out_cnt);
-+ else
-+ writefd_unbuffered(sock_f_out, iobuf_out, iobuf_out_cnt);
-+ iobuf_out_cnt = 0;
-+ }
-+
+- msg2genr_flush(flush_it_all);
+- msg2sndr_flush();
+ if (am_generator())
-+ msg_list_flush(flush_it_all);
- }
++ msg_list_flush();
+
+ if (!iobuf_out_cnt || no_flush)
+ return;
+@@ -1211,11 +1138,6 @@ void io_flush(int flush_it_all)
static void writefd(int fd,char *buf,size_t len)
{
if (fd == sock_f_out)
stats.total_written += len;
-@@ -1402,9 +1352,3 @@ void start_write_batch(int fd)
+@@ -1428,9 +1350,3 @@ void start_write_batch(int fd)
else
write_batch_monitor_in = fd;
}
extern int allow_8bit_chars;
extern int protocol_version;
extern int preserve_times;
-@@ -75,7 +74,6 @@ struct {
+@@ -76,7 +75,6 @@ struct {
{ RERR_IPC , "error in IPC code" },
{ RERR_CRASHED , "sibling process crashed" },
{ RERR_TERMINATED , "sibling process terminated abnormally" },
extern int am_daemon;
extern int blocking_io;
extern int remove_sent_files;
-@@ -84,9 +83,20 @@ struct pid_status {
+@@ -85,9 +84,20 @@ struct pid_status {
static time_t starttime, endtime;
static int64 total_read, total_written;
+}
+
/* Works like waitpid(), but if we already harvested the child pid in our
- * sigchld_handler(), we succeed instead of returning an error. */
+ * remember_children(), we succeed instead of returning an error. */
pid_t wait_process(pid_t pid, int *status_ptr, int flags)
-@@ -163,7 +173,7 @@ static void handle_stats(int f)
+@@ -164,7 +174,7 @@ static void handle_stats(int f)
show_flist_stats();
}
return;
if (am_daemon) {
-@@ -618,12 +628,30 @@ static void do_server_sender(int f_in, i
+@@ -628,12 +638,30 @@ static void do_server_sender(int f_in, i
exit_cleanup(0);
}
/* The receiving side mustn't obey this, or an existing symlink that
* points to an identical file won't be replaced by the referent. */
-@@ -632,70 +660,16 @@ static int do_recv(int f_in,int f_out,st
+@@ -642,70 +670,16 @@ static int do_recv(int f_in,int f_out,st
if (preserve_hard_links)
init_hard_links();
generate_files(f_out, flist, local_name);
handle_stats(-1);
-@@ -706,10 +680,13 @@ static int do_recv(int f_in,int f_out,st
+@@ -716,10 +690,13 @@ static int do_recv(int f_in,int f_out,st
}
io_flush(FULL_FLUSH);
}
-@@ -1077,22 +1054,6 @@ static int start_client(int argc, char *
+@@ -1089,22 +1066,6 @@ static int start_client(int argc, char *
return ret;
}
- _exit(0);
-}
-
- static RETSIGTYPE sigchld_handler(UNUSED(int val))
+ RETSIGTYPE remember_children(UNUSED(int val))
{
#ifdef WNOHANG
-@@ -1184,8 +1145,6 @@ int main(int argc,char *argv[])
+@@ -1196,8 +1157,6 @@ int main(int argc,char *argv[])
# endif
sigact.sa_flags = SA_NOCLDSTOP;
#endif
- SIGACTMASK(SIGUSR1, sigusr1_handler);
- SIGACTMASK(SIGUSR2, sigusr2_handler);
- SIGACTMASK(SIGCHLD, sigchld_handler);
+ SIGACTMASK(SIGCHLD, remember_children);
#ifdef MAINTAINER_MODE
SIGACTMASK(SIGSEGV, rsync_panic_handler);
--- old/match.c
+++ new/match.c
-@@ -21,7 +21,7 @@
+@@ -20,7 +20,7 @@
+ #include "rsync.h"
extern int verbose;
- extern int am_server;
-extern int do_progress;
+extern int recv_progress;
extern int checksum_seed;
extern int append_mode;
-@@ -133,7 +133,7 @@ static void matched(int f, struct sum_st
+@@ -110,7 +110,7 @@ static void matched(int f, struct sum_st
else
last_match = offset;
show_progress(last_match, buf->file_size);
}
-@@ -333,7 +333,7 @@ void match_sums(int f, struct sum_struct
+@@ -314,7 +314,7 @@ void match_sums(int f, struct sum_struct
if (append_mode) {
OFF_T j = 0;
for (j = CHUNK_SIZE; j < s->flength; j += CHUNK_SIZE) {
show_progress(last_match, buf->file_size);
sum_update(map_ptr(buf, last_match, CHUNK_SIZE),
CHUNK_SIZE);
-@@ -341,7 +341,7 @@ void match_sums(int f, struct sum_struct
+@@ -322,7 +322,7 @@ void match_sums(int f, struct sum_struct
}
if (last_match < s->flength) {
int32 len = s->flength - last_match;
last_match = s->flength;
--- old/options.c
+++ new/options.c
-@@ -73,7 +73,6 @@ int def_compress_level = Z_DEFAULT_COMPR
+@@ -74,7 +74,6 @@ int def_compress_level = Z_DEFAULT_COMPR
int am_root = 0;
int am_server = 0;
int am_sender = 0;
-int am_generator = 0;
int am_starting_up = 1;
- int orig_umask = 0;
int relative_paths = -1;
+ int implied_dirs = 1;
@@ -95,6 +94,7 @@ int am_daemon = 0;
int daemon_over_rsh = 0;
int do_stats = 0;
int keep_partial = 0;
int safe_symlinks = 0;
int copy_unsafe_links = 0;
-@@ -1295,6 +1295,7 @@ int parse_arguments(int *argc, const cha
+@@ -1301,6 +1301,7 @@ int parse_arguments(int *argc, const cha
if (do_progress && !verbose && !log_before_transfer && !am_server)
verbose = 1;
extern int log_before_transfer;
extern int log_format_has_i;
extern int daemon_log_format_has_i;
-@@ -158,7 +158,7 @@ static int receive_data(int f_in, char *
+@@ -153,7 +153,7 @@ static int receive_data(int f_in, char *
if (sum.remainder)
sum.flength -= sum.blength - sum.remainder;
for (j = CHUNK_SIZE; j < sum.flength; j += CHUNK_SIZE) {
show_progress(offset, total_size);
sum_update(map_ptr(mapbuf, offset, CHUNK_SIZE),
CHUNK_SIZE);
-@@ -166,7 +166,7 @@ static int receive_data(int f_in, char *
+@@ -161,7 +161,7 @@ static int receive_data(int f_in, char *
}
if (offset < sum.flength) {
int32 len = sum.flength - offset;
show_progress(offset, total_size);
sum_update(map_ptr(mapbuf, offset, len), len);
offset = sum.flength;
-@@ -179,7 +179,7 @@ static int receive_data(int f_in, char *
+@@ -174,7 +174,7 @@ static int receive_data(int f_in, char *
}
while ((i = recv_token(f_in, &data)) != 0) {
show_progress(offset, total_size);
if (i > 0) {
-@@ -247,7 +247,7 @@ static int receive_data(int f_in, char *
+@@ -242,7 +242,7 @@ static int receive_data(int f_in, char *
ftruncate(fd, offset);
#endif
end_progress(total_size);
if (fd != -1 && offset > 0 && sparse_end(fd) != 0) {
-@@ -298,12 +298,12 @@ static void handle_delayed_updates(struc
+@@ -293,12 +293,12 @@ static void handle_delayed_updates(struc
"rename failed for %s (from %s)",
full_fname(fname), partialptr);
} else {
handle_partial_dir(partialptr, PDIR_DELETE);
}
}
-@@ -354,11 +354,6 @@ int recv_files(int f_in, struct file_lis
+@@ -349,11 +349,6 @@ int recv_files(int f_in, struct file_lis
if (verbose > 2)
rprintf(FINFO,"recv_files(%d) starting\n",flist->count);
if (delay_updates)
delayed_bits = bitbag_create(flist->count);
-@@ -379,7 +374,7 @@ int recv_files(int f_in, struct file_lis
+@@ -374,7 +369,7 @@ int recv_files(int f_in, struct file_lis
rprintf(FINFO, "recv_files phase=%d\n", phase);
if (phase == 2 && delay_updates)
handle_delayed_updates(flist, local_name);
if (keep_partial && !partial_dir)
make_backups = 0; /* prevents double backup */
if (append_mode) {
-@@ -601,7 +596,7 @@ int recv_files(int f_in, struct file_lis
+@@ -596,7 +591,7 @@ int recv_files(int f_in, struct file_lis
/* log the transfer */
if (log_before_transfer)
log_item(file, &initial_stats, iflags, NULL);
rprintf(FINFO, "%s\n", fname);
/* recv file data */
-@@ -644,11 +639,13 @@ int recv_files(int f_in, struct file_lis
+@@ -639,11 +634,13 @@ int recv_files(int f_in, struct file_lis
cleanup_disable();
if (recv_ok > 0) {
} else if (!recv_ok) {
int msgtype = phase || read_batch ? FERROR : FINFO;
if (msgtype == FERROR || verbose) {
-@@ -671,8 +668,8 @@ int recv_files(int f_in, struct file_lis
+@@ -666,8 +663,8 @@ int recv_files(int f_in, struct file_lis
errstr, fname, keptstr, redostr);
}
if (!phase) {
}
--- old/rsync.c
+++ new/rsync.c
-@@ -41,7 +41,6 @@ extern int orig_umask;
+@@ -40,7 +40,6 @@ extern int omit_dir_times;
extern int am_root;
extern int am_server;
extern int am_sender;
extern int am_starting_up;
extern int allow_8bit_chars;
extern int preserve_uid;
-@@ -300,5 +299,5 @@ const char *who_am_i(void)
+@@ -303,5 +302,5 @@ const char *who_am_i(void)
{
if (am_starting_up)
return am_server ? "server" : "client";
--- old/util.c
+++ new/util.c
-@@ -404,49 +404,6 @@ int robust_rename(char *from, char *to,
+@@ -420,49 +420,6 @@ int robust_rename(char *from, char *to,
return -1;
}