#define RERR_MALLOC 22 /* error allocating core memory buffers */
--- old/generator.c
+++ new/generator.c
-@@ -67,7 +67,6 @@ extern OFF_T min_size;
+@@ -66,7 +66,6 @@ extern OFF_T min_size;
extern int io_error;
extern int allowed_lull;
extern int sock_f_out;
extern int protocol_version;
extern int fuzzy_basis;
extern int always_checksum;
-@@ -95,6 +94,11 @@ extern struct filter_list_struct server_
+@@ -94,6 +93,11 @@ extern struct filter_list_struct server_
static int deletion_count = 0; /* used to implement --max-delete */
/* For calling delete_file() */
#define DEL_FORCE_RECURSE (1<<1) /* recurse even w/o --force */
#define DEL_TERSE (1<<3)
-@@ -443,8 +447,8 @@ static void sum_sizes_sqroot(struct sum_
+@@ -444,8 +448,8 @@ static void sum_sizes_sqroot(struct sum_
}
if (protocol_version < 27) {
s2length = SUM_LENGTH;
} else {
int32 c;
-@@ -454,7 +458,7 @@ static void sum_sizes_sqroot(struct sum_
+@@ -455,7 +459,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);
}
-@@ -488,7 +492,7 @@ static void generate_and_send_sums(int f
+@@ -489,7 +493,7 @@ static void generate_and_send_sums(int f
sum_sizes_sqroot(&sum, len);
write_sum_head(f_out, &sum);
return;
if (len > 0)
-@@ -507,7 +511,7 @@ static void generate_and_send_sums(int f
+@@ -508,7 +512,7 @@ static void generate_and_send_sums(int f
if (f_copy >= 0) {
full_write(f_copy, map, n1);
continue;
}
-@@ -1182,7 +1186,7 @@ static void recv_generator(char *fname,
+@@ -1200,7 +1204,7 @@ static void recv_generator(char *fname,
return;
}
return;
if (fnamecmp_type <= FNAMECMP_BASIS_DIR_HIGH)
-@@ -1237,7 +1241,7 @@ static void recv_generator(char *fname,
+@@ -1263,7 +1267,7 @@ static void recv_generator(char *fname,
goto notify_others;
}
if (!(backupptr = get_backup_name(fname))) {
close(fd);
return;
-@@ -1328,9 +1332,12 @@ void generate_files(int f_out, struct fi
+@@ -1354,9 +1358,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;
if (protocol_version >= 29) {
itemizing = 1;
maybe_ATTRS_REPORT = stdout_format_has_i ? 0 : ATTRS_REPORT;
-@@ -1358,7 +1365,7 @@ void generate_files(int f_out, struct fi
+@@ -1384,7 +1391,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",
-@@ -1367,12 +1374,6 @@ void generate_files(int f_out, struct fi
+@@ -1393,12 +1400,6 @@ void generate_files(int f_out, struct fi
: "enabled");
}
for (i = 0; i < flist->count; i++) {
struct file_struct *file = flist->files[i];
-@@ -1416,23 +1417,34 @@ void generate_files(int f_out, struct fi
+@@ -1442,23 +1443,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
-@@ -1444,27 +1456,43 @@ void generate_files(int f_out, struct fi
+@@ -1470,27 +1482,43 @@ void generate_files(int f_out, struct fi
phase++;
ignore_non_existing = save_ignore_non_existing;
ignore_existing = save_ignore_existing;
extern int csum_length;
extern int checksum_seed;
extern int protocol_version;
--extern int remove_sent_files;
+-extern int remove_source_files;
extern int preserve_hard_links;
extern char *filesfrom_host;
extern struct stats stats;
- exit_cleanup(RERR_STREAMIO);
- }
- read_loop(fd, buf, 4);
-- if (remove_sent_files)
+- if (remove_source_files)
- decrement_active_files(IVAL(buf,0));
- flist_ndx_push(&redo_list, IVAL(buf,0));
- break;
- exit_cleanup(RERR_STREAMIO);
- }
- read_loop(fd, buf, len);
-- if (remove_sent_files) {
+- if (remove_source_files) {
- decrement_active_files(IVAL(buf,0));
- send_msg(MSG_SUCCESS, buf, len);
- }
extern int allow_8bit_chars;
extern int protocol_version;
extern int preserve_times;
-@@ -72,7 +71,6 @@ struct {
+@@ -75,7 +74,6 @@ struct {
{ RERR_IPC , "error in IPC code" },
{ RERR_CRASHED , "sibling process crashed" },
{ RERR_TERMINATED , "sibling process terminated abnormally" },
{ RERR_SIGNAL , "received SIGINT, SIGTERM, or SIGHUP" },
{ RERR_WAITCHILD , "waitpid() failed" },
{ RERR_MALLOC , "error allocating core memory buffers" },
-@@ -224,8 +222,8 @@ void rwrite(enum logcode code, char *buf
+@@ -242,8 +240,8 @@ void rwrite(enum logcode code, char *buf
if (len < 0)
exit_cleanup(RERR_MESSAGEIO);
-extern int am_generator;
extern int am_daemon;
extern int blocking_io;
- extern int remove_sent_files;
+ extern int remove_source_files;
@@ -93,9 +92,20 @@ struct pid_status {
static time_t starttime, endtime;
return;
if (am_daemon) {
-@@ -647,12 +657,30 @@ static void do_server_sender(int f_in, i
+@@ -658,12 +668,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. */
-@@ -661,70 +689,16 @@ static int do_recv(int f_in,int f_out,st
+@@ -672,70 +700,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);
-@@ -735,10 +709,13 @@ static int do_recv(int f_in,int f_out,st
+@@ -746,10 +720,13 @@ static int do_recv(int f_in,int f_out,st
}
io_flush(FULL_FLUSH);
}
-@@ -1140,22 +1117,6 @@ static int start_client(int argc, char *
+@@ -1151,22 +1128,6 @@ static int start_client(int argc, char *
return ret;
}
RETSIGTYPE remember_children(UNUSED(int val))
{
#ifdef WNOHANG
-@@ -1247,8 +1208,6 @@ int main(int argc,char *argv[])
+@@ -1258,8 +1219,6 @@ int main(int argc,char *argv[])
# endif
sigact.sa_flags = SA_NOCLDSTOP;
#endif
int keep_partial = 0;
int safe_symlinks = 0;
int copy_unsafe_links = 0;
-@@ -1304,6 +1304,7 @@ int parse_arguments(int *argc, const cha
+@@ -1305,6 +1305,7 @@ int parse_arguments(int *argc, const cha
if (do_progress && !verbose && !log_before_transfer && !am_server)
verbose = 1;
"rename failed for %s (from %s)",
full_fname(fname), partialptr);
} else {
-- if (remove_sent_files
+- if (remove_source_files
- || (preserve_hard_links
- && file->link_u.links)) {
-+ if (remove_sent_files) {
++ if (remove_source_files) {
SIVAL(numbuf, 0, i);
send_msg(MSG_SUCCESS,numbuf,4);
}
@@ -597,7 +592,7 @@ int recv_files(int f_in, struct file_lis
/* log the transfer */
if (log_before_transfer)
- log_item(FNAME, file, &initial_stats, iflags, NULL);
+ log_item(FCLIENT, file, &initial_stats, iflags, NULL);
- else if (!am_server && verbose && do_progress)
+ else if (!am_server && verbose && recv_progress)
rprintf(FINFO, "%s\n", fname);
cleanup_disable();
if (recv_ok > 0) {
-- if (remove_sent_files
+- if (remove_source_files
- || (preserve_hard_links && file->link_u.links)) {
-+ if (remove_sent_files) {
++ if (remove_source_files) {
+ decrement_active_files(i);
SIVAL(numbuf, 0, i);
send_msg(MSG_SUCCESS, numbuf, 4);
}
--- old/rsync.c
+++ new/rsync.c
-@@ -40,7 +40,6 @@ extern int omit_dir_times;
+@@ -39,7 +39,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;
-@@ -302,5 +301,5 @@ const char *who_am_i(void)
+@@ -300,5 +299,5 @@ const char *who_am_i(void)
{
if (am_starting_up)
return am_server ? "server" : "client";