If you try this out, please send some email to wayned@samba.org or the rsync
mailing list with your results, build changes, bug reports, etc. Thanks!
-Be sure to run "make proto" before running "make".
+After applying this patch, run these commands for a successful build:
---- orig/Makefile.in 2006-01-14 08:14:29
-+++ Makefile.in 2005-12-10 18:35:39
+ ./prepare-source
+ ./configure (optional if already run)
+ make
+
+--- old/Makefile.in
++++ new/Makefile.in
@@ -6,7 +6,7 @@ exec_prefix=@exec_prefix@
bindir=@bindir@
mandir=@mandir@
CC=@CC@
CFLAGS=@CFLAGS@
CPPFLAGS=@CPPFLAGS@
---- orig/cleanup.c 2006-02-03 20:00:35
-+++ cleanup.c 2006-02-03 20:07:44
+--- old/cleanup.c
++++ new/cleanup.c
@@ -26,10 +26,6 @@ extern int keep_partial;
extern int log_got_error;
extern char *partial_dir;
if (cleanup_pid && cleanup_pid == getpid()) {
char *pidf = lp_pid_file();
if (pidf && *pidf)
---- orig/errcode.h 2005-12-16 23:48:43
-+++ errcode.h 2005-12-16 23:50:02
+--- old/errcode.h
++++ new/errcode.h
@@ -37,7 +37,6 @@
#define RERR_CRASHED 15 /* sibling crashed */
#define RERR_TERMINATED 16 /* sibling terminated abnormally */
#define RERR_SIGNAL 20 /* status returned when sent SIGINT, SIGTERM, SIGHUP */
#define RERR_WAITCHILD 21 /* some error returned by waitpid() */
#define RERR_MALLOC 22 /* error allocating core memory buffers */
---- orig/generator.c 2006-01-31 18:59:39
-+++ generator.c 2005-12-08 23:17:08
-@@ -68,7 +68,6 @@ extern OFF_T min_size;
+--- old/generator.c
++++ new/generator.c
+@@ -67,7 +67,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;
-@@ -99,6 +98,11 @@ static int deletion_count = 0; /* used t
+@@ -98,6 +97,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)
-@@ -448,8 +452,8 @@ static void sum_sizes_sqroot(struct sum_
+@@ -446,8 +450,8 @@ static void sum_sizes_sqroot(struct sum_
}
if (protocol_version < 27) {
s2length = SUM_LENGTH;
} else {
int32 c;
-@@ -459,7 +463,7 @@ static void sum_sizes_sqroot(struct sum_
+@@ -457,7 +461,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);
}
-@@ -493,7 +497,7 @@ static void generate_and_send_sums(int f
+@@ -491,7 +495,7 @@ static void generate_and_send_sums(int f
sum_sizes_sqroot(&sum, len);
write_sum_head(f_out, &sum);
return;
if (len > 0)
-@@ -512,7 +516,7 @@ static void generate_and_send_sums(int f
+@@ -510,7 +514,7 @@ static void generate_and_send_sums(int f
if (f_copy >= 0) {
full_write(f_copy, map, n1);
continue;
}
-@@ -1142,7 +1146,7 @@ static void recv_generator(char *fname,
+@@ -1140,7 +1144,7 @@ static void recv_generator(char *fname,
return;
}
return;
if (fnamecmp_type <= FNAMECMP_BASIS_DIR_HIGH)
-@@ -1197,7 +1201,7 @@ static void recv_generator(char *fname,
+@@ -1195,7 +1199,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
+@@ -1284,7 +1288,10 @@ 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;
-@@ -1315,7 +1322,7 @@ void generate_files(int f_out, struct fi
+@@ -1313,7 +1320,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
+@@ -1322,12 +1329,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
+@@ -1371,23 +1372,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
+@@ -1399,27 +1411,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;
---- orig/io.c 2006-02-04 21:53:39
-+++ io.c 2006-02-01 19:50:09
+--- old/io.c
++++ new/io.c
@@ -47,7 +47,6 @@ extern int allowed_lull;
extern int am_server;
extern int am_daemon;
- write_batch_monitor_out = -1;
- write_batch_monitor_in = -1;
-}
---- orig/log.c 2006-02-05 04:53:34
-+++ log.c 2005-12-16 23:49:57
+--- old/log.c
++++ new/log.c
@@ -38,7 +38,6 @@ extern int am_sender;
extern int local_server;
extern int quiet;
extern int module_id;
-extern int msg_fd_out;
+ extern int allow_8bit_chars;
extern int protocol_version;
extern int preserve_times;
- extern int log_format_has_i;
-@@ -74,7 +73,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" },
-@@ -234,8 +232,8 @@ void rwrite(enum logcode code, char *buf
+@@ -232,8 +230,8 @@ void rwrite(enum logcode code, char *buf
if (quiet && code == FINFO)
return;
send_msg((enum msgcode)code, buf, len);
return;
}
---- orig/main.c 2006-02-05 04:53:34
-+++ main.c 2006-02-02 02:43:44
+--- old/main.c
++++ new/main.c
@@ -30,7 +30,6 @@ extern int list_only;
extern int am_root;
extern int am_server;
SIGACTMASK(SIGCHLD, sigchld_handler);
#ifdef MAINTAINER_MODE
SIGACTMASK(SIGSEGV, rsync_panic_handler);
---- orig/match.c 2005-11-10 16:58:36
-+++ match.c 2005-12-08 23:17:09
+--- old/match.c
++++ new/match.c
@@ -21,7 +21,7 @@
extern int verbose;
show_progress(last_match, buf->file_size);
sum_update(map_ptr(buf, last_match, len), len);
last_match = s->flength;
---- orig/options.c 2006-02-03 23:51:57
-+++ options.c 2005-12-08 23:17:09
+--- old/options.c
++++ new/options.c
@@ -73,7 +73,6 @@ int def_compress_level = Z_DEFAULT_COMPR
int am_root = 0;
int am_server = 0;
int am_starting_up = 1;
int orig_umask = 0;
int relative_paths = -1;
-@@ -94,6 +93,7 @@ int am_daemon = 0;
+@@ -95,6 +94,7 @@ int am_daemon = 0;
int daemon_over_rsh = 0;
int do_stats = 0;
int do_progress = 0;
int keep_partial = 0;
int safe_symlinks = 0;
int copy_unsafe_links = 0;
-@@ -1290,6 +1290,7 @@ int parse_arguments(int *argc, const cha
- if ((do_progress || dry_run) && !verbose && !log_before_transfer
- && !am_server)
+@@ -1292,6 +1292,7 @@ int parse_arguments(int *argc, const cha
+
+ if (do_progress && !verbose && !log_before_transfer && !am_server)
verbose = 1;
+ recv_progress = do_progress;
if (dry_run)
do_xfers = 0;
---- orig/pipe.c 2006-01-21 08:03:40
-+++ pipe.c 2005-12-08 23:17:09
+--- old/pipe.c
++++ new/pipe.c
@@ -56,7 +56,7 @@ pid_t piped_child(char **command, int *f
exit_cleanup(RERR_IPC);
}
if (pid == -1) {
rsyserr(FERROR, errno, "fork");
exit_cleanup(RERR_IPC);
---- orig/receiver.c 2006-01-31 02:30:18
-+++ receiver.c 2006-01-14 08:30:29
+--- old/receiver.c
++++ new/receiver.c
@@ -24,7 +24,7 @@ extern int verbose;
extern int do_xfers;
extern int am_daemon;
extern int log_before_transfer;
extern int log_format_has_i;
extern int daemon_log_format_has_i;
-@@ -219,7 +219,7 @@ static int receive_data(int f_in, char *
+@@ -158,7 +158,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);
-@@ -227,7 +227,7 @@ static int receive_data(int f_in, char *
+@@ -166,7 +166,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;
-@@ -240,7 +240,7 @@ static int receive_data(int f_in, char *
+@@ -179,7 +179,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) {
-@@ -308,7 +308,7 @@ static int receive_data(int f_in, char *
+@@ -247,7 +247,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) {
-@@ -359,12 +359,12 @@ static void handle_delayed_updates(struc
+@@ -298,12 +298,12 @@ static void handle_delayed_updates(struc
"rename failed for %s (from %s)",
full_fname(fname), partialptr);
} else {
handle_partial_dir(partialptr, PDIR_DELETE);
}
}
-@@ -415,11 +415,6 @@ int recv_files(int f_in, struct file_lis
+@@ -354,11 +354,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)
- init_delayed_bits(flist->count);
+ delayed_bits = bitbag_create(flist->count);
-@@ -440,7 +435,7 @@ int recv_files(int f_in, struct file_lis
+@@ -379,7 +374,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) {
-@@ -662,7 +657,7 @@ int recv_files(int f_in, struct file_lis
+@@ -601,7 +596,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 */
-@@ -705,11 +700,12 @@ int recv_files(int f_in, struct file_lis
+@@ -644,11 +639,12 @@ 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) {
-@@ -731,10 +727,8 @@ int recv_files(int f_in, struct file_lis
+@@ -670,10 +666,8 @@ int recv_files(int f_in, struct file_lis
"%s: %s failed verification -- update %s%s.\n",
errstr, fname, keptstr, redostr);
}
}
}
make_backups = save_make_backups;
---- orig/rsync.c 2006-02-05 04:53:34
-+++ rsync.c 2005-12-08 23:17:10
+--- old/rsync.c
++++ new/rsync.c
@@ -41,7 +41,6 @@ extern int orig_umask;
extern int am_root;
extern int am_server;
extern int am_sender;
-extern int am_generator;
extern int am_starting_up;
+ extern int allow_8bit_chars;
extern int preserve_uid;
- extern int preserve_gid;
-@@ -288,5 +287,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";
- return am_sender ? "sender" : am_generator ? "generator" : "receiver";
+ return am_sender ? "sender" : am_generator() ? "generator" : "receiver";
}
---- orig/rsync.h 2006-02-03 20:00:36
-+++ rsync.h 2006-01-17 02:46:03
+--- old/rsync.h
++++ new/rsync.h
@@ -166,10 +166,8 @@ enum msgcode {
MSG_DATA=0, /* raw data on the multiplexed stream */
MSG_ERROR=FERROR, MSG_INFO=FINFO, /* remote logging */
#include "lib/pool_alloc.h"
---- orig/util.c 2006-02-03 20:00:36
-+++ util.c 2005-12-08 23:17:10
-@@ -413,51 +413,6 @@ int robust_rename(char *from, char *to,
+--- old/util.c
++++ new/util.c
+@@ -404,49 +404,6 @@ int robust_rename(char *from, char *to,
return -1;
}
--
-static pid_t all_pids[10];
-static int num_pids;
-
- kill(p, sig);
- }
-}
--
-
/** Turn a user name into a uid */
int name_to_uid(char *name, uid_t *uid)