From 7cf8a5515da2ce8ec6b3bd11f51cc890a6b24b5e Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Tue, 25 Apr 2006 20:32:41 +0000 Subject: [PATCH] Fixed some high-level patch fuzz. --- fsync.diff | 20 +++--- id-pair.diff | 40 ++++++------ threaded-receiver.diff | 134 ++++++++++++++++++++--------------------- 3 files changed, 97 insertions(+), 97 deletions(-) diff --git a/fsync.diff b/fsync.diff index e207e1e..a7a45c7 100644 --- a/fsync.diff +++ b/fsync.diff @@ -3,7 +3,7 @@ to be called on every file we write. --- old/options.c +++ new/options.c -@@ -43,6 +43,7 @@ int append_mode = 0; +@@ -45,6 +45,7 @@ int append_mode = 0; int keep_dirlinks = 0; int copy_dirlinks = 0; int copy_links = 0; @@ -19,7 +19,7 @@ to be called on every file we write. rprintf(F," --numeric-ids don't map uid/gid values by user/group name\n"); 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"); -@@ -504,6 +506,7 @@ static struct poptOption long_options[] +@@ -506,6 +508,7 @@ static struct poptOption long_options[] {"only-write-batch", 0, POPT_ARG_STRING, &batch_name, OPT_ONLY_WRITE_BATCH, 0, 0 }, {"files-from", 0, POPT_ARG_STRING, &files_from, 0, 0, 0 }, {"from0", '0', POPT_ARG_NONE, &eol_nulls, 0, 0, 0}, @@ -27,7 +27,7 @@ to be called on every file we write. {"numeric-ids", 0, POPT_ARG_NONE, &numeric_ids, 0, 0, 0 }, {"timeout", 0, POPT_ARG_INT, &io_timeout, 0, 0, 0 }, {"rsh", 'e', POPT_ARG_STRING, &shell_cmd, 0, 0, 0 }, -@@ -1705,6 +1708,9 @@ void server_options(char **args,int *arg +@@ -1706,6 +1709,9 @@ void server_options(char **args,int *arg args[ac++] = tmpdir; } @@ -39,7 +39,7 @@ to be called on every file we write. * and it may be an older version that doesn't know this --- old/receiver.c +++ new/receiver.c -@@ -36,6 +36,7 @@ extern int protocol_version; +@@ -38,6 +38,7 @@ extern int protocol_version; extern int relative_paths; extern int preserve_hard_links; extern int preserve_perms; @@ -47,7 +47,7 @@ to be called on every file we write. extern int basis_dir_cnt; extern int make_backups; extern int cleanup_got_literal; -@@ -252,6 +253,12 @@ static int receive_data(int f_in, char * +@@ -254,6 +255,12 @@ static int receive_data(int f_in, char * exit_cleanup(RERR_FILEIO); } @@ -62,9 +62,9 @@ to be called on every file we write. if (mapbuf) --- old/t_stub.c +++ new/t_stub.c -@@ -26,6 +26,7 @@ - * functions, so that module test harnesses can run standalone. - **/ +@@ -22,6 +22,7 @@ + + #include "rsync.h" +int do_fsync = 0; int modify_window = 0; @@ -72,7 +72,7 @@ to be called on every file we write. int relative_paths = 0; --- old/util.c +++ new/util.c -@@ -30,6 +30,7 @@ +@@ -26,6 +26,7 @@ extern int verbose; extern int dry_run; extern int module_id; @@ -80,7 +80,7 @@ to be called on every file we write. extern int modify_window; extern int relative_paths; extern int human_readable; -@@ -319,6 +320,12 @@ int copy_file(const char *source, const +@@ -309,6 +310,12 @@ int copy_file(const char *source, const return -1; } diff --git a/id-pair.diff b/id-pair.diff index 4caf5fd..8fa4fac 100644 --- a/id-pair.diff +++ b/id-pair.diff @@ -10,15 +10,15 @@ gets to be really large. --- old/flist.c +++ new/flist.c -@@ -60,6 +60,7 @@ extern int protocol_version; +@@ -54,6 +54,7 @@ extern int copy_unsafe_links; + extern int protocol_version; extern int sanitize_paths; - extern const char *io_write_phase; extern struct stats stats; +extern struct id_pair *id_pairs; extern struct file_list *the_file_list; extern char curr_dir[MAXPATHLEN]; -@@ -363,14 +364,14 @@ static void send_file_entry(struct file_ +@@ -355,14 +356,14 @@ static void send_file_entry(struct file_ } } else if (protocol_version < 28) rdev = makedev(0, 0); @@ -37,7 +37,7 @@ gets to be really large. if (file->modtime == modtime) flags |= XMIT_SAME_TIME; else -@@ -623,8 +624,7 @@ static struct file_struct *receive_file_ +@@ -613,8 +614,7 @@ static struct file_struct *receive_file_ file->modtime = modtime; file->length = file_length; file->mode = mode; @@ -47,7 +47,7 @@ gets to be really large. if (dirname_len) { file->dirname = lastdir = bp; -@@ -875,8 +875,7 @@ struct file_struct *make_file(char *fnam +@@ -865,8 +865,7 @@ struct file_struct *make_file(char *fnam file->modtime = st.st_mtime; file->length = st.st_size; file->mode = st.st_mode; @@ -57,7 +57,7 @@ gets to be really large. #ifdef SUPPORT_HARD_LINKS if (flist && flist->hlink_pool) { -@@ -944,8 +943,7 @@ struct file_struct *make_file(char *fnam +@@ -934,8 +933,7 @@ struct file_struct *make_file(char *fnam file->modtime = st2.st_mtime; file->length = st2.st_size; file->mode = st2.st_mode; @@ -67,7 +67,7 @@ gets to be really large. file->u.link = NULL; } else file->mode = save_mode; -@@ -1389,7 +1387,7 @@ struct file_list *recv_file_list(int f) +@@ -1379,7 +1377,7 @@ struct file_list *recv_file_list(int f) clean_flist(flist, relative_paths, 1); if (f >= 0) { @@ -76,7 +76,7 @@ gets to be really large. /* Recv the io_error flag */ if (lp_ignore_errors(module_id) || ignore_errors) -@@ -1705,13 +1703,15 @@ static void output_flist(struct file_lis +@@ -1695,13 +1693,15 @@ static void output_flist(struct file_lis for (i = 0; i < flist->count; i++) { file = flist->files[i]; @@ -100,7 +100,7 @@ gets to be really large. sprintf(depthbuf, "%d", file->dir.depth); --- old/generator.c +++ new/generator.c -@@ -91,6 +91,7 @@ extern dev_t filesystem_dev; +@@ -90,6 +90,7 @@ extern dev_t filesystem_dev; extern char *backup_dir; extern char *backup_suffix; extern int backup_suffix_len; @@ -108,7 +108,7 @@ gets to be really large. extern struct file_list *the_file_list; extern struct filter_list_struct server_filter_list; -@@ -326,10 +327,12 @@ int unchanged_attrs(struct file_struct * +@@ -323,10 +324,12 @@ int unchanged_attrs(struct file_struct * && (st->st_mode & CHMOD_BITS) != (file->mode & CHMOD_BITS)) return 0; @@ -123,7 +123,7 @@ gets to be really large. return 0; return 1; -@@ -342,6 +345,8 @@ void itemize(struct file_struct *file, i +@@ -339,6 +342,8 @@ void itemize(struct file_struct *file, i int keep_time = !preserve_times ? 0 : S_ISDIR(file->mode) ? !omit_dir_times : !S_ISLNK(file->mode); @@ -132,7 +132,7 @@ gets to be really large. if (S_ISREG(file->mode) && file->length != st->st_size) iflags |= ITEM_REPORT_SIZE; -@@ -351,10 +356,10 @@ void itemize(struct file_struct *file, i +@@ -348,10 +353,10 @@ void itemize(struct file_struct *file, i iflags |= ITEM_REPORT_TIME; if ((file->mode & CHMOD_BITS) != (st->st_mode & CHMOD_BITS)) iflags |= ITEM_REPORT_PERMS; @@ -148,7 +148,7 @@ gets to be really large. iflags |= ITEM_IS_NEW; --- old/log.c +++ new/log.c -@@ -48,6 +48,7 @@ extern int daemon_log_format_has_o_or_i; +@@ -43,6 +43,7 @@ extern int daemon_log_format_has_o_or_i; extern mode_t orig_umask; extern char *auth_user; extern char *log_format; @@ -156,7 +156,7 @@ gets to be really large. #if defined HAVE_ICONV_OPEN && defined HAVE_ICONV_H extern iconv_t ic_chck; #endif -@@ -480,16 +481,16 @@ static void log_formatted(enum logcode c +@@ -475,16 +476,16 @@ static void log_formatted(enum logcode c case 'U': strlcat(fmt, "ld", sizeof fmt); snprintf(buf2, sizeof buf2, fmt, @@ -235,7 +235,7 @@ gets to be really large. rsyserr(FERROR, errno, "%s %s failed", --- old/rsync.h +++ new/rsync.h -@@ -493,6 +493,11 @@ struct hlink { +@@ -495,6 +495,11 @@ struct hlink { int hlindex; }; @@ -247,7 +247,7 @@ gets to be really large. #define F_DEV link_u.idev->dev #define F_INODE link_u.idev->inode -@@ -517,8 +522,7 @@ struct file_struct { +@@ -519,8 +524,7 @@ struct file_struct { struct hlink *links; } link_u; time_t modtime; @@ -259,7 +259,7 @@ gets to be really large. }; --- old/uidlist.c +++ new/uidlist.c -@@ -37,6 +37,8 @@ extern int preserve_gid; +@@ -38,6 +38,8 @@ extern int preserve_gid; extern int numeric_ids; extern int am_root; @@ -268,7 +268,7 @@ gets to be really large. struct idlist { struct idlist *next; int id, id2; -@@ -46,6 +48,8 @@ struct idlist { +@@ -47,6 +49,8 @@ struct idlist { static struct idlist *uidlist; static struct idlist *gidlist; @@ -277,7 +277,7 @@ gets to be really large. static struct idlist *add_to_list(struct idlist **root, int id, char *name, int id2) { -@@ -307,7 +311,7 @@ void send_uid_list(int f) +@@ -308,7 +312,7 @@ void send_uid_list(int f) /* recv a complete uid/gid mapping from the peer and map the uid/gid * in the file list to local names */ @@ -286,7 +286,7 @@ gets to be really large. { int id, i; char *name; -@@ -338,11 +342,40 @@ void recv_uid_list(int f, struct file_li +@@ -339,11 +343,40 @@ void recv_uid_list(int f, struct file_li /* Now convert all the uids/gids from sender values to our values. */ if (am_root && preserve_uid && !numeric_ids) { diff --git a/threaded-receiver.diff b/threaded-receiver.diff index 48f7a18..f219a94 100644 --- a/threaded-receiver.diff +++ b/threaded-receiver.diff @@ -37,7 +37,7 @@ After applying this patch, run these commands for a successful build: CPPFLAGS=@CPPFLAGS@ --- old/cleanup.c +++ new/cleanup.c -@@ -26,10 +26,6 @@ extern int keep_partial; +@@ -28,10 +28,6 @@ extern int keep_partial; extern int log_got_error; extern char *partial_dir; @@ -48,7 +48,7 @@ After applying this patch, run these commands for a successful build: /** * Close all open sockets and files, allowing a (somewhat) graceful * shutdown() of socket connections. This eliminates the abortive -@@ -98,9 +94,6 @@ void _exit_cleanup(int code, const char +@@ -100,9 +96,6 @@ void _exit_cleanup(int code, const char } inside_cleanup++; @@ -58,7 +58,7 @@ After applying this patch, run these commands for a successful build: if (verbose > 3) { rprintf(FINFO,"_exit_cleanup(code=%d, file=%s, line=%d): entered\n", code, file, line); -@@ -132,8 +125,6 @@ void _exit_cleanup(int code, const char +@@ -134,8 +127,6 @@ void _exit_cleanup(int code, const char io_flush(FULL_FLUSH); if (cleanup_fname) do_unlink(cleanup_fname); @@ -87,9 +87,9 @@ After applying this patch, run these commands for a successful build: extern int protocol_version; extern int fuzzy_basis; extern int always_checksum; -@@ -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; +@@ -95,6 +94,11 @@ extern struct filter_list_struct server_ + + static int deletion_count = 0; /* used to implement --max-delete */ +/* These vars are local copies so that the receiver can use the originals. */ +static int GEN_append_mode; @@ -99,7 +99,7 @@ After applying this patch, run these commands for a successful build: /* For calling delete_file() */ #define DEL_FORCE_RECURSE (1<<1) /* recurse even w/o --force */ #define DEL_TERSE (1<<3) -@@ -445,8 +449,8 @@ static void sum_sizes_sqroot(struct sum_ +@@ -443,8 +447,8 @@ static void sum_sizes_sqroot(struct sum_ } if (protocol_version < 27) { @@ -110,7 +110,7 @@ After applying this patch, run these commands for a successful build: s2length = SUM_LENGTH; } else { int32 c; -@@ -456,7 +460,7 @@ static void sum_sizes_sqroot(struct sum_ +@@ -454,7 +458,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-- */ @@ -119,7 +119,7 @@ After applying this patch, run these commands for a successful build: s2length = MIN(s2length, SUM_LENGTH); } -@@ -490,7 +494,7 @@ static void generate_and_send_sums(int f +@@ -488,7 +492,7 @@ static void generate_and_send_sums(int f sum_sizes_sqroot(&sum, len); write_sum_head(f_out, &sum); @@ -128,7 +128,7 @@ After applying this patch, run these commands for a successful build: return; if (len > 0) -@@ -509,7 +513,7 @@ static void generate_and_send_sums(int f +@@ -507,7 +511,7 @@ static void generate_and_send_sums(int f if (f_copy >= 0) { full_write(f_copy, map, n1); @@ -137,7 +137,7 @@ After applying this patch, run these commands for a successful build: continue; } -@@ -1152,7 +1156,7 @@ static void recv_generator(char *fname, +@@ -1175,7 +1179,7 @@ static void recv_generator(char *fname, return; } @@ -146,7 +146,7 @@ After applying this patch, run these commands for a successful build: return; if (fnamecmp_type <= FNAMECMP_BASIS_DIR_HIGH) -@@ -1207,7 +1211,7 @@ static void recv_generator(char *fname, +@@ -1230,7 +1234,7 @@ static void recv_generator(char *fname, goto notify_others; } @@ -155,7 +155,7 @@ After applying this patch, run these commands for a successful build: if (!(backupptr = get_backup_name(fname))) { close(fd); return; -@@ -1298,9 +1302,12 @@ void generate_files(int f_out, struct fi +@@ -1321,9 +1325,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; @@ -169,7 +169,7 @@ After applying this patch, run these commands for a successful build: if (protocol_version >= 29) { itemizing = 1; maybe_ATTRS_REPORT = log_format_has_i ? 0 : ATTRS_REPORT; -@@ -1328,7 +1335,7 @@ void generate_files(int f_out, struct fi +@@ -1351,7 +1358,7 @@ void generate_files(int f_out, struct fi do_delete_pass(flist); do_progress = 0; @@ -178,7 +178,7 @@ After applying this patch, run these commands for a successful build: whole_file = 0; if (verbose >= 2) { rprintf(FINFO, "delta-transmission %s\n", -@@ -1337,12 +1344,6 @@ void generate_files(int f_out, struct fi +@@ -1360,12 +1367,6 @@ void generate_files(int f_out, struct fi : "enabled"); } @@ -191,7 +191,7 @@ After applying this patch, run these commands for a successful build: for (i = 0; i < flist->count; i++) { struct file_struct *file = flist->files[i]; -@@ -1386,23 +1387,34 @@ void generate_files(int f_out, struct fi +@@ -1409,23 +1410,34 @@ void generate_files(int f_out, struct fi delete_in_dir(NULL, NULL, NULL, NULL); phase++; @@ -232,7 +232,7 @@ After applying this patch, run these commands for a successful build: if (local_name) strlcpy(fbuf, local_name, sizeof fbuf); else -@@ -1414,27 +1426,43 @@ void generate_files(int f_out, struct fi +@@ -1437,27 +1449,43 @@ void generate_files(int f_out, struct fi phase++; ignore_non_existing = save_ignore_non_existing; ignore_existing = save_ignore_existing; @@ -285,7 +285,7 @@ After applying this patch, run these commands for a successful build: do_progress = save_do_progress; --- old/io.c +++ new/io.c -@@ -46,20 +46,17 @@ extern int allowed_lull; +@@ -40,20 +40,17 @@ extern int allowed_lull; extern int am_server; extern int am_daemon; extern int am_sender; @@ -306,7 +306,7 @@ After applying this patch, run these commands for a successful build: int batch_fd = -1; int batch_gen_fd = -1; -@@ -83,7 +80,6 @@ const char *io_read_phase = phase_unknow +@@ -61,7 +58,6 @@ int batch_gen_fd = -1; int kluge_around_eof = 0; int msg_fd_in = -1; @@ -314,7 +314,7 @@ After applying this patch, run these commands for a successful build: int sock_f_in = -1; int sock_f_out = -1; -@@ -110,27 +106,31 @@ static OFF_T active_bytecnt = 0; +@@ -88,27 +84,31 @@ static OFF_T active_bytecnt = 0; static void read_loop(int fd, char *buf, size_t len); struct flist_ndx_item { @@ -352,7 +352,7 @@ After applying this patch, run these commands for a successful build: static void flist_ndx_push(struct flist_ndx_list *lp, int ndx) { -@@ -140,27 +140,31 @@ static void flist_ndx_push(struct flist_ +@@ -118,27 +118,31 @@ static void flist_ndx_push(struct flist_ out_of_memory("flist_ndx_push"); item->next = NULL; item->ndx = ndx; @@ -390,7 +390,7 @@ After applying this patch, run these commands for a successful build: return ndx; } -@@ -169,7 +173,7 @@ static void check_timeout(void) +@@ -147,7 +151,7 @@ static void check_timeout(void) { time_t t; @@ -399,7 +399,7 @@ After applying this patch, run these commands for a successful build: return; if (!last_io_in) { -@@ -210,44 +214,38 @@ void set_io_timeout(int secs) +@@ -188,44 +192,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 @@ -460,7 +460,7 @@ After applying this patch, run these commands for a successful build: static void read_msg_fd(void) { char buf[2048]; -@@ -266,57 +264,6 @@ static void read_msg_fd(void) +@@ -244,57 +242,6 @@ static void read_msg_fd(void) tag = (tag >> 24) - MPLEX_BASE; switch (tag) { @@ -518,7 +518,7 @@ After applying this patch, run these commands for a successful build: case MSG_INFO: case MSG_ERROR: case MSG_LOG: -@@ -325,10 +272,7 @@ static void read_msg_fd(void) +@@ -303,10 +250,7 @@ static void read_msg_fd(void) if (n >= sizeof buf) n = sizeof buf - 1; read_loop(fd, buf, n); @@ -530,7 +530,7 @@ After applying this patch, run these commands for a successful build: len -= n; } break; -@@ -362,70 +306,76 @@ void decrement_active_files(int ndx) +@@ -341,70 +285,76 @@ void decrement_active_files(int ndx) active_bytecnt -= the_file_list->files[ndx]->length; } @@ -651,7 +651,7 @@ After applying this patch, run these commands for a successful build: return flist_ndx_pop(&hlink_list); } -@@ -505,11 +455,6 @@ static int read_timeout(int fd, char *bu +@@ -484,11 +434,6 @@ static int read_timeout(int fd, char *bu FD_ZERO(&r_fds); FD_ZERO(&w_fds); FD_SET(fd, &r_fds); @@ -663,7 +663,7 @@ After applying this patch, run these commands for a successful build: if (io_filesfrom_f_out >= 0) { int new_fd; if (io_filesfrom_buflen == 0) { -@@ -542,9 +487,6 @@ static int read_timeout(int fd, char *bu +@@ -521,9 +466,6 @@ static int read_timeout(int fd, char *bu continue; } @@ -673,7 +673,7 @@ After applying this patch, run these commands for a successful build: if (io_filesfrom_f_out >= 0) { if (io_filesfrom_buflen) { if (FD_ISSET(io_filesfrom_f_out, &w_fds)) { -@@ -866,6 +808,8 @@ static void readfd(int fd, char *buffer, +@@ -845,6 +787,8 @@ static void readfd(int fd, char *buffer, } if (fd == write_batch_monitor_in) { @@ -682,7 +682,7 @@ After applying this patch, run these commands for a successful build: if ((size_t)write(batch_fd, buffer, total) != total) exit_cleanup(RERR_FILEIO); } -@@ -1127,7 +1071,6 @@ static void writefd_unbuffered(int fd,ch +@@ -1106,7 +1050,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); @@ -690,7 +690,7 @@ After applying this patch, run these commands for a successful build: readfd_unbuffered(sock_f_in, io_filesfrom_buf, sizeof io_filesfrom_buf); } -@@ -1138,7 +1081,7 @@ static void writefd_unbuffered(int fd,ch +@@ -1117,7 +1060,7 @@ static void writefd_unbuffered(int fd,ch defer_forwarding_messages = 1; if (fd == sock_f_out) { @@ -699,7 +699,7 @@ After applying this patch, run these commands for a successful build: last_io_out = time(NULL); sleep_for_bwlimit(cnt); } -@@ -1148,23 +1091,6 @@ static void writefd_unbuffered(int fd,ch +@@ -1127,23 +1070,6 @@ static void writefd_unbuffered(int fd,ch no_flush--; } @@ -723,7 +723,7 @@ After applying this patch, run these commands for a successful build: /** * Write an message to a multiplexed stream. If this fails then rsync * exits. -@@ -1190,14 +1116,15 @@ static void mplex_write(enum msgcode cod +@@ -1169,14 +1095,15 @@ static void mplex_write(enum msgcode cod defer_forwarding_messages = 1; writefd_unbuffered(sock_f_out, buf, len); defer_forwarding_messages = 0; @@ -742,7 +742,7 @@ After applying this patch, run these commands for a successful build: if (!iobuf_out_cnt || no_flush) return; -@@ -1211,11 +1138,6 @@ void io_flush(int flush_it_all) +@@ -1190,11 +1117,6 @@ void io_flush(int flush_it_all) static void writefd(int fd,char *buf,size_t len) { @@ -754,7 +754,7 @@ After applying this patch, run these commands for a successful build: if (fd == sock_f_out) stats.total_written += len; -@@ -1428,9 +1350,3 @@ void start_write_batch(int fd) +@@ -1400,9 +1322,3 @@ void start_write_batch(int fd) else write_batch_monitor_in = fd; } @@ -766,7 +766,7 @@ After applying this patch, run these commands for a successful build: -} --- old/log.c +++ new/log.c -@@ -38,7 +38,6 @@ extern int am_sender; +@@ -33,7 +33,6 @@ extern int am_sender; extern int local_server; extern int quiet; extern int module_id; @@ -774,7 +774,7 @@ After applying this patch, run these commands for a successful build: extern int allow_8bit_chars; extern int protocol_version; extern int preserve_times; -@@ -76,7 +75,6 @@ struct { +@@ -71,7 +70,6 @@ struct { { RERR_IPC , "error in IPC code" }, { RERR_CRASHED , "sibling process crashed" }, { RERR_TERMINATED , "sibling process terminated abnormally" }, @@ -782,7 +782,7 @@ After applying this patch, run these commands for a successful build: { RERR_SIGNAL , "received SIGINT, SIGTERM, or SIGHUP" }, { RERR_WAITCHILD , "waitpid() failed" }, { RERR_MALLOC , "error allocating core memory buffers" }, -@@ -232,8 +230,8 @@ void rwrite(enum logcode code, char *buf +@@ -227,8 +225,8 @@ void rwrite(enum logcode code, char *buf if (quiet && code == FINFO) return; @@ -795,7 +795,7 @@ After applying this patch, run these commands for a successful build: } --- old/main.c +++ new/main.c -@@ -30,7 +30,6 @@ extern int list_only; +@@ -32,7 +32,6 @@ extern int list_only; extern int am_root; extern int am_server; extern int am_sender; @@ -803,7 +803,7 @@ After applying this patch, run these commands for a successful build: extern int am_daemon; extern int blocking_io; extern int remove_sent_files; -@@ -85,9 +84,20 @@ struct pid_status { +@@ -87,9 +86,20 @@ struct pid_status { static time_t starttime, endtime; static int64 total_read, total_written; @@ -824,7 +824,7 @@ After applying this patch, run these commands for a successful build: /* Works like waitpid(), but if we already harvested the child pid in our * remember_children(), we succeed instead of returning an error. */ pid_t wait_process(pid_t pid, int *status_ptr, int flags) -@@ -164,7 +174,7 @@ static void handle_stats(int f) +@@ -166,7 +176,7 @@ static void handle_stats(int f) show_flist_stats(); } @@ -833,7 +833,7 @@ After applying this patch, run these commands for a successful build: return; if (am_daemon) { -@@ -628,12 +638,30 @@ static void do_server_sender(int f_in, i +@@ -630,12 +640,30 @@ static void do_server_sender(int f_in, i exit_cleanup(0); } @@ -867,7 +867,7 @@ After applying this patch, run these commands for a successful build: /* The receiving side mustn't obey this, or an existing symlink that * points to an identical file won't be replaced by the referent. */ -@@ -642,70 +670,16 @@ static int do_recv(int f_in,int f_out,st +@@ -644,70 +672,16 @@ static int do_recv(int f_in,int f_out,st if (preserve_hard_links) init_hard_links(); @@ -943,7 +943,7 @@ After applying this patch, run these commands for a successful build: generate_files(f_out, flist, local_name); handle_stats(-1); -@@ -716,10 +690,13 @@ static int do_recv(int f_in,int f_out,st +@@ -718,10 +692,13 @@ static int do_recv(int f_in,int f_out,st } io_flush(FULL_FLUSH); @@ -961,7 +961,7 @@ After applying this patch, run these commands for a successful build: } -@@ -1089,22 +1066,6 @@ static int start_client(int argc, char * +@@ -1091,22 +1068,6 @@ static int start_client(int argc, char * return ret; } @@ -984,7 +984,7 @@ After applying this patch, run these commands for a successful build: RETSIGTYPE remember_children(UNUSED(int val)) { #ifdef WNOHANG -@@ -1196,8 +1157,6 @@ int main(int argc,char *argv[]) +@@ -1198,8 +1159,6 @@ int main(int argc,char *argv[]) # endif sigact.sa_flags = SA_NOCLDSTOP; #endif @@ -995,7 +995,7 @@ After applying this patch, run these commands for a successful build: SIGACTMASK(SIGSEGV, rsync_panic_handler); --- old/match.c +++ new/match.c -@@ -20,7 +20,7 @@ +@@ -23,7 +23,7 @@ #include "rsync.h" extern int verbose; @@ -1004,7 +1004,7 @@ After applying this patch, run these commands for a successful build: extern int checksum_seed; extern int append_mode; -@@ -110,7 +110,7 @@ static void matched(int f, struct sum_st +@@ -113,7 +113,7 @@ static void matched(int f, struct sum_st else last_match = offset; @@ -1013,7 +1013,7 @@ After applying this patch, run these commands for a successful build: show_progress(last_match, buf->file_size); } -@@ -314,7 +314,7 @@ void match_sums(int f, struct sum_struct +@@ -317,7 +317,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) { @@ -1022,7 +1022,7 @@ After applying this patch, run these commands for a successful build: show_progress(last_match, buf->file_size); sum_update(map_ptr(buf, last_match, CHUNK_SIZE), CHUNK_SIZE); -@@ -322,7 +322,7 @@ void match_sums(int f, struct sum_struct +@@ -325,7 +325,7 @@ void match_sums(int f, struct sum_struct } if (last_match < s->flength) { int32 len = s->flength - last_match; @@ -1049,7 +1049,7 @@ After applying this patch, run these commands for a successful build: int keep_partial = 0; int safe_symlinks = 0; int copy_unsafe_links = 0; -@@ -1301,6 +1301,7 @@ int parse_arguments(int *argc, const cha +@@ -1300,6 +1300,7 @@ int parse_arguments(int *argc, const cha if (do_progress && !verbose && !log_before_transfer && !am_server) verbose = 1; @@ -1059,7 +1059,7 @@ After applying this patch, run these commands for a successful build: do_xfers = 0; --- old/pipe.c +++ new/pipe.c -@@ -56,7 +56,7 @@ pid_t piped_child(char **command, int *f +@@ -58,7 +58,7 @@ pid_t piped_child(char **command, int *f exit_cleanup(RERR_IPC); } @@ -1068,7 +1068,7 @@ After applying this patch, run these commands for a successful build: if (pid == -1) { rsyserr(FERROR, errno, "fork"); exit_cleanup(RERR_IPC); -@@ -120,7 +120,7 @@ pid_t local_child(int argc, char **argv, +@@ -122,7 +122,7 @@ pid_t local_child(int argc, char **argv, exit_cleanup(RERR_IPC); } @@ -1079,7 +1079,7 @@ After applying this patch, run these commands for a successful build: exit_cleanup(RERR_IPC); --- old/receiver.c +++ new/receiver.c -@@ -24,7 +24,7 @@ extern int verbose; +@@ -26,7 +26,7 @@ extern int verbose; extern int do_xfers; extern int am_daemon; extern int am_server; @@ -1088,7 +1088,7 @@ After applying this patch, run these commands for a successful build: extern int log_before_transfer; extern int log_format_has_i; extern int daemon_log_format_has_i; -@@ -153,7 +153,7 @@ static int receive_data(int f_in, char * +@@ -155,7 +155,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) { @@ -1097,7 +1097,7 @@ After applying this patch, run these commands for a successful build: show_progress(offset, total_size); sum_update(map_ptr(mapbuf, offset, CHUNK_SIZE), CHUNK_SIZE); -@@ -161,7 +161,7 @@ static int receive_data(int f_in, char * +@@ -163,7 +163,7 @@ static int receive_data(int f_in, char * } if (offset < sum.flength) { int32 len = sum.flength - offset; @@ -1106,7 +1106,7 @@ After applying this patch, run these commands for a successful build: show_progress(offset, total_size); sum_update(map_ptr(mapbuf, offset, len), len); offset = sum.flength; -@@ -174,7 +174,7 @@ static int receive_data(int f_in, char * +@@ -176,7 +176,7 @@ static int receive_data(int f_in, char * } while ((i = recv_token(f_in, &data)) != 0) { @@ -1115,7 +1115,7 @@ After applying this patch, run these commands for a successful build: show_progress(offset, total_size); if (i > 0) { -@@ -242,7 +242,7 @@ static int receive_data(int f_in, char * +@@ -244,7 +244,7 @@ static int receive_data(int f_in, char * ftruncate(fd, offset); #endif @@ -1124,7 +1124,7 @@ After applying this patch, run these commands for a successful build: end_progress(total_size); if (fd != -1 && offset > 0 && sparse_end(fd) != 0) { -@@ -293,12 +293,12 @@ static void handle_delayed_updates(struc +@@ -295,12 +295,12 @@ static void handle_delayed_updates(struc "rename failed for %s (from %s)", full_fname(fname), partialptr); } else { @@ -1140,7 +1140,7 @@ After applying this patch, run these commands for a successful build: handle_partial_dir(partialptr, PDIR_DELETE); } } -@@ -349,11 +349,6 @@ int recv_files(int f_in, struct file_lis +@@ -351,11 +351,6 @@ int recv_files(int f_in, struct file_lis if (verbose > 2) rprintf(FINFO,"recv_files(%d) starting\n",flist->count); @@ -1152,7 +1152,7 @@ After applying this patch, run these commands for a successful build: if (delay_updates) delayed_bits = bitbag_create(flist->count); -@@ -374,7 +369,7 @@ int recv_files(int f_in, struct file_lis +@@ -376,7 +371,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); @@ -1161,7 +1161,7 @@ After applying this patch, run these commands for a successful build: if (keep_partial && !partial_dir) make_backups = 0; /* prevents double backup */ if (append_mode) { -@@ -596,7 +591,7 @@ int recv_files(int f_in, struct file_lis +@@ -598,7 +593,7 @@ int recv_files(int f_in, struct file_lis /* log the transfer */ if (log_before_transfer) log_item(file, &initial_stats, iflags, NULL); @@ -1170,7 +1170,7 @@ After applying this patch, run these commands for a successful build: rprintf(FINFO, "%s\n", fname); /* recv file data */ -@@ -639,11 +634,13 @@ int recv_files(int f_in, struct file_lis +@@ -641,11 +636,13 @@ int recv_files(int f_in, struct file_lis cleanup_disable(); if (recv_ok > 0) { @@ -1186,7 +1186,7 @@ After applying this patch, run these commands for a successful build: } else if (!recv_ok) { int msgtype = phase || read_batch ? FERROR : FINFO; if (msgtype == FERROR || verbose) { -@@ -666,8 +663,8 @@ int recv_files(int f_in, struct file_lis +@@ -668,8 +665,8 @@ int recv_files(int f_in, struct file_lis errstr, fname, keptstr, redostr); } if (!phase) { @@ -1216,7 +1216,7 @@ After applying this patch, run these commands for a successful build: } --- old/rsync.h +++ new/rsync.h -@@ -166,10 +166,8 @@ enum msgcode { +@@ -168,10 +168,8 @@ enum msgcode { MSG_DATA=0, /* raw data on the multiplexed stream */ MSG_ERROR=FERROR, MSG_INFO=FINFO, /* remote logging */ MSG_LOG=FLOG, MSG_SOCKERR=FSOCKERR, /* sibling logging */ @@ -1227,7 +1227,7 @@ After applying this patch, run these commands for a successful build: }; #include "errcode.h" -@@ -320,6 +318,7 @@ enum msgcode { +@@ -322,6 +320,7 @@ enum msgcode { #endif #include @@ -1237,7 +1237,7 @@ After applying this patch, run these commands for a successful build: --- old/util.c +++ new/util.c -@@ -420,49 +420,6 @@ int robust_rename(char *from, char *to, +@@ -410,49 +410,6 @@ int robust_rename(char *from, char *to, return -1; } -- 2.34.1