From: Wayne Davison Date: Fri, 13 Oct 2006 07:53:38 +0000 (+0000) Subject: Fixed failing hunks. X-Git-Url: https://mattmccutchen.net/rsync/rsync-patches.git/commitdiff_plain/3758a5a59bfb6afca4bffbef23dc0f1cf0ec3e5d Fixed failing hunks. --- diff --git a/acls.diff b/acls.diff index b7ea4a3..94a7cd0 100644 --- a/acls.diff +++ b/acls.diff @@ -1742,7 +1742,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync. } - if (set_file_attrs(fname, file, statret ? NULL : &st, 0) + if (set_file_attrs(fname, file, statret ? NULL : &sx, 0) - && verbose && code && f_out != -1) + && verbose && code != FNONE && f_out != -1) rprintf(code, "%s/\n", fname); if (delete_during && f_out != -1 && !phase && dry_run < 2 && (file->flags & FLAG_DEL_HERE)) @@ -1795,7 +1795,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync. statret = -1; } else if (basis_dir[0] != NULL) { if (try_dests_non(file, fname, ndx, itemizing, -@@ -1014,7 +1066,7 @@ static void recv_generator(char *fname, +@@ -1015,7 +1067,7 @@ static void recv_generator(char *fname, } } if (preserve_hard_links && file->link_u.links @@ -1804,7 +1804,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync. itemizing, code, HL_SKIP)) return; if (do_symlink(file->u.link,fname) != 0) { -@@ -1023,7 +1075,7 @@ static void recv_generator(char *fname, +@@ -1024,7 +1076,7 @@ static void recv_generator(char *fname, } else { set_file_attrs(fname, file, NULL, 0); if (itemizing) { @@ -1812,9 +1812,9 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync. + itemize(file, ndx, statret, &sx, ITEM_LOCAL_CHANGE, 0, NULL); } - if (code && verbose) { -@@ -1054,18 +1106,22 @@ static void recv_generator(char *fname, - itemizing = code = 0; + if (code != FNONE && verbose) { +@@ -1056,18 +1108,22 @@ static void recv_generator(char *fname, + code = FNONE; } } +#ifdef SUPPORT_ACLS @@ -1844,7 +1844,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync. statret = -1; if (verbose > 2) { rprintf(FINFO,"mknod(%s,0%o,0x%x)\n", -@@ -1078,7 +1134,7 @@ static void recv_generator(char *fname, +@@ -1080,7 +1136,7 @@ static void recv_generator(char *fname, } else { set_file_attrs(fname, file, NULL, 0); if (itemizing) { @@ -1852,8 +1852,8 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync. + itemize(file, ndx, statret, &sx, ITEM_LOCAL_CHANGE, 0, NULL); } - if (code && verbose) -@@ -1092,14 +1148,14 @@ static void recv_generator(char *fname, + if (code != FNONE && verbose) +@@ -1094,14 +1150,14 @@ static void recv_generator(char *fname, } } else { if (itemizing) @@ -1871,7 +1871,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync. } if (!S_ISREG(file->mode)) { -@@ -1133,7 +1189,7 @@ static void recv_generator(char *fname, +@@ -1135,7 +1191,7 @@ static void recv_generator(char *fname, } if (update_only && statret == 0 @@ -1880,7 +1880,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync. if (verbose > 1) rprintf(FINFO, "%s is newer\n", fname); return; -@@ -1142,20 +1198,20 @@ static void recv_generator(char *fname, +@@ -1144,20 +1200,20 @@ static void recv_generator(char *fname, fnamecmp = fname; fnamecmp_type = FNAMECMP_FNAME; @@ -1905,7 +1905,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync. } if (j >= 0) { fnamecmp = fnamecmpbuf; -@@ -1165,7 +1221,7 @@ static void recv_generator(char *fname, +@@ -1167,7 +1223,7 @@ static void recv_generator(char *fname, } real_ret = statret; @@ -1914,7 +1914,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync. if (partial_dir && (partialptr = partial_dir_fname(fname)) != NULL && link_stat(partialptr, &partial_st, 0) == 0 -@@ -1184,7 +1240,7 @@ static void recv_generator(char *fname, +@@ -1186,7 +1242,7 @@ static void recv_generator(char *fname, rprintf(FINFO, "fuzzy basis selected for %s: %s\n", fname, fnamecmpbuf); } @@ -1923,7 +1923,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync. statret = 0; fnamecmp = fnamecmpbuf; fnamecmp_type = FNAMECMP_FUZZY; -@@ -1193,7 +1249,7 @@ static void recv_generator(char *fname, +@@ -1195,7 +1251,7 @@ static void recv_generator(char *fname, if (statret != 0) { if (preserve_hard_links && file->link_u.links @@ -1932,7 +1932,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync. itemizing, code, HL_SKIP)) return; if (stat_errno == ENOENT) -@@ -1203,39 +1259,52 @@ static void recv_generator(char *fname, +@@ -1205,39 +1261,52 @@ static void recv_generator(char *fname, return; } @@ -1992,7 +1992,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync. fnamecmp = partialptr; fnamecmp_type = FNAMECMP_PARTIAL_DIR; statret = 0; -@@ -1259,17 +1328,21 @@ static void recv_generator(char *fname, +@@ -1261,17 +1330,21 @@ static void recv_generator(char *fname, pretend_missing: /* pretend the file didn't exist */ if (preserve_hard_links && file->link_u.links @@ -2017,7 +2017,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync. } if (!(back_file = make_file(fname, NULL, NULL, 0, NO_FILTERS))) { close(fd); -@@ -1280,7 +1353,7 @@ static void recv_generator(char *fname, +@@ -1282,7 +1355,7 @@ static void recv_generator(char *fname, full_fname(backupptr)); free(back_file); close(fd); @@ -2026,7 +2026,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync. } if ((f_copy = do_open(backupptr, O_WRONLY | O_CREAT | O_TRUNC | O_EXCL, 0600)) < 0) { -@@ -1288,14 +1361,14 @@ static void recv_generator(char *fname, +@@ -1290,14 +1363,14 @@ static void recv_generator(char *fname, full_fname(backupptr)); free(back_file); close(fd); @@ -2043,7 +2043,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync. } if (verbose > 2) -@@ -1313,24 +1386,32 @@ static void recv_generator(char *fname, +@@ -1315,24 +1388,32 @@ static void recv_generator(char *fname, iflags |= ITEM_BASIS_TYPE_FOLLOWS; if (fnamecmp_type == FNAMECMP_FUZZY) iflags |= ITEM_XNAME_FOLLOWS; @@ -2081,7 +2081,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync. if (f_copy >= 0) { close(f_copy); -@@ -1343,6 +1424,13 @@ static void recv_generator(char *fname, +@@ -1345,6 +1426,13 @@ static void recv_generator(char *fname, } close(fd); @@ -2095,7 +2095,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync. } void generate_files(int f_out, struct file_list *flist, char *local_name) -@@ -1402,6 +1490,8 @@ void generate_files(int f_out, struct fi +@@ -1404,6 +1492,8 @@ void generate_files(int f_out, struct fi * notice that and let us know via the redo pipe (or its closing). */ ignore_timeout = 1; @@ -2160,10 +2160,10 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync. statret = 1; - st = &st3; + sxp->st = st3; - if (verbose < 2 || !stdout_format_has_i) - itemizing = code = 0; - break; -@@ -223,12 +228,16 @@ int hard_link_check(struct file_struct * + if (verbose < 2 || !stdout_format_has_i) { + itemizing = 0; + code = FNONE; +@@ -225,12 +230,16 @@ int hard_link_check(struct file_struct * if (!unchanged_file(cmpbuf, file, &st3)) continue; statret = 1; @@ -2183,7 +2183,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync. toname, &st2, itemizing, code); if (remove_source_files == 1 && do_xfers) { char numbuf[4]; -@@ -246,7 +255,7 @@ int hard_link_check(struct file_struct * +@@ -248,7 +257,7 @@ int hard_link_check(struct file_struct * #ifdef SUPPORT_HARD_LINKS int hard_link_one(struct file_struct *file, int ndx, char *fname, @@ -2192,7 +2192,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync. int itemizing, enum logcode code) { if (do_link(toname, fname)) { -@@ -262,7 +271,11 @@ int hard_link_one(struct file_struct *fi +@@ -264,7 +273,11 @@ int hard_link_one(struct file_struct *fi } if (itemizing) { @@ -2205,7 +2205,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync. ITEM_LOCAL_CHANGE | ITEM_XNAME_FOLLOWS, 0, terse ? "" : toname); } -@@ -279,11 +292,12 @@ void hard_link_cluster(struct file_struc +@@ -281,11 +294,12 @@ void hard_link_cluster(struct file_struc #ifdef SUPPORT_HARD_LINKS char hlink1[MAXPATHLEN]; char *hlink2; @@ -2220,7 +2220,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync. return; if (!(file->flags & FLAG_HLINK_TOL)) { while (!(file->flags & FLAG_HLINK_EOL)) { -@@ -297,9 +311,13 @@ void hard_link_cluster(struct file_struc +@@ -299,9 +313,13 @@ void hard_link_cluster(struct file_struc if (file->F_HLINDEX != SKIPPED_LINK) continue; hlink2 = f_name(file, NULL); @@ -5518,7 +5518,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync. +int sys_acl_free_qualifier(void *qual, SMB_ACL_TAG_T tagtype); --- old/log.c +++ new/log.c -@@ -607,8 +607,10 @@ static void log_formatted(enum logcode c +@@ -615,8 +615,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'; @@ -5647,7 +5647,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync. extern struct stats stats; extern char *stdout_format; extern char *tmpdir; -@@ -349,6 +350,10 @@ int recv_files(int f_in, struct file_lis +@@ -350,6 +351,10 @@ int recv_files(int f_in, struct file_lis int itemizing = am_server ? logfile_format_has_i : stdout_format_has_i; enum logcode log_code = log_before_transfer ? FLOG : FINFO; int max_phase = protocol_version >= 29 ? 2 : 1; @@ -5658,7 +5658,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync. int i, recv_ok; if (verbose > 2) -@@ -549,7 +554,16 @@ int recv_files(int f_in, struct file_lis +@@ -553,7 +558,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; @@ -5893,9 +5893,9 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync. #include "byteorder.h" #include "lib/mdfour.h" #include "lib/wildmatch.h" -@@ -668,6 +688,16 @@ struct chmod_mode_struct; - +@@ -669,6 +689,16 @@ struct chmod_mode_struct; #define UNUSED(x) x __attribute__((__unused__)) + #define NORETURN __attribute__((__noreturn__)) +typedef struct { + STRUCT_STAT st; diff --git a/atimes.diff b/atimes.diff index 435319f..beb4cfb 100644 --- a/atimes.diff +++ b/atimes.diff @@ -174,7 +174,7 @@ After applying this patch, run these commands for a successful build: void *save_filters; unsigned int len = strlen(fbuf); if (len > 1 && fbuf[len-1] == '/') -@@ -1585,8 +1610,9 @@ static void clean_flist(struct file_list +@@ -1581,8 +1606,9 @@ static void clean_flist(struct file_list } /* Make sure we don't lose track of a user-specified * top directory. */ @@ -186,7 +186,7 @@ After applying this patch, run these commands for a successful build: clear_file(flist->files[drop], flist); -@@ -1710,7 +1736,7 @@ static void output_flist(struct file_lis +@@ -1706,7 +1732,7 @@ static void output_flist(struct file_lis file->dirname ? file->dirname : "", file->dirname ? "/" : "", NS(file->basename), S_ISDIR(file->mode) ? "/" : "", (int)file->mode, @@ -205,7 +205,7 @@ After applying this patch, run these commands for a successful build: extern int omit_dir_times; extern int delete_mode; extern int delete_before; -@@ -89,6 +90,7 @@ extern dev_t filesystem_dev; +@@ -90,6 +91,7 @@ extern dev_t filesystem_dev; extern char *backup_dir; extern char *backup_suffix; extern int backup_suffix_len; @@ -213,7 +213,7 @@ After applying this patch, run these commands for a successful build: extern struct file_list *the_file_list; extern struct filter_list_struct server_filter_list; -@@ -181,7 +183,7 @@ static int delete_item(char *fname, int +@@ -182,7 +184,7 @@ static int delete_item(char *fname, int for (j = dirlist->count; j--; ) { struct file_struct *fp = dirlist->files[j]; @@ -222,7 +222,7 @@ After applying this patch, run these commands for a successful build: continue; strlcpy(p, fp->basename, remainder); -@@ -259,7 +261,7 @@ static void delete_in_dir(struct file_li +@@ -260,7 +262,7 @@ static void delete_in_dir(struct file_li filt_array[cur_depth] = push_local_filters(fbuf, dlen); if (one_file_system) { @@ -231,7 +231,7 @@ After applying this patch, run these commands for a successful build: filesystem_dev = stp->st_dev; else if (filesystem_dev != stp->st_dev) return; -@@ -271,7 +273,7 @@ static void delete_in_dir(struct file_li +@@ -272,7 +274,7 @@ static void delete_in_dir(struct file_li * from the filesystem. */ for (i = dirlist->count; i--; ) { struct file_struct *fp = dirlist->files[i]; @@ -240,7 +240,7 @@ After applying this patch, run these commands for a successful build: continue; if (flist_find(flist, fp) < 0) { f_name(fp, delbuf); -@@ -297,11 +299,11 @@ static void do_delete_pass(struct file_l +@@ -298,11 +300,11 @@ static void do_delete_pass(struct file_l for (j = 0; j < flist->count; j++) { struct file_struct *file = flist->files[j]; @@ -254,7 +254,7 @@ After applying this patch, run these commands for a successful build: rprintf(FINFO, "deleting in %s\n", fbuf); if (link_stat(fbuf, &st, keep_dirlinks) < 0 -@@ -345,6 +347,9 @@ void itemize(struct file_struct *file, i +@@ -346,6 +348,9 @@ void itemize(struct file_struct *file, i && (!(iflags & ITEM_XNAME_FOLLOWS) || *xname)) || (keep_time && cmp_time(file->modtime, st->st_mtime) != 0)) iflags |= ITEM_REPORT_TIME; @@ -264,7 +264,7 @@ After applying this patch, run these commands for a successful build: if ((file->mode & CHMOD_BITS) != (st->st_mode & CHMOD_BITS)) iflags |= ITEM_REPORT_PERMS; if (preserve_uid && am_root && file->uid != st->st_uid) -@@ -548,7 +553,7 @@ static int find_fuzzy(struct file_struct +@@ -549,7 +554,7 @@ static int find_fuzzy(struct file_struct uint32 dist; if (!S_ISREG(fp->mode) || !fp->length @@ -273,7 +273,7 @@ After applying this patch, run these commands for a successful build: continue; name = fp->basename; -@@ -657,6 +662,8 @@ static int try_dests_reg(struct file_str +@@ -658,6 +663,8 @@ static int try_dests_reg(struct file_str itemizing && verbose > 1, code) < 0) goto try_a_copy; @@ -282,8 +282,8 @@ After applying this patch, run these commands for a successful build: if (preserve_hard_links && file->link_u.links) { if (dry_run) file->link_u.links->link_dest_used = j + 1; -@@ -937,7 +944,7 @@ static void recv_generator(char *fname, - && verbose && code && f_out != -1) +@@ -944,7 +951,7 @@ static void recv_generator(char *fname, + && verbose && code != FNONE && f_out != -1) rprintf(code, "%s/\n", fname); if (delete_during && f_out != -1 && !phase && dry_run < 2 - && (file->flags & FLAG_DEL_HERE)) @@ -291,7 +291,7 @@ After applying this patch, run these commands for a successful build: delete_in_dir(the_file_list, fname, file, &st); return; } -@@ -1240,7 +1247,7 @@ static void recv_generator(char *fname, +@@ -1249,7 +1256,7 @@ static void recv_generator(char *fname, if (fuzzy_dirlist) { int j = flist_find(fuzzy_dirlist, file); if (j >= 0) /* don't use changing file as future fuzzy basis */ @@ -332,7 +332,7 @@ After applying this patch, run these commands for a successful build: head = hlink_list[file->F_HLINDEX] = file->F_NEXT; else head = hlink_list[file->F_HLINDEX]; -@@ -285,8 +286,8 @@ void hard_link_cluster(struct file_struc +@@ -287,8 +288,8 @@ void hard_link_cluster(struct file_struc file->F_HLINDEX = FINISHED_LINK; if (link_stat(f_name(file, hlink1), &st1, 0) < 0) return; @@ -343,7 +343,7 @@ After applying this patch, run these commands for a successful build: ndx = file->F_NEXT; file = FPTR(ndx); } -@@ -306,6 +307,6 @@ void hard_link_cluster(struct file_struc +@@ -308,6 +309,6 @@ void hard_link_cluster(struct file_struc send_msg(MSG_SUCCESS, numbuf, 4); } file->F_HLINDEX = FINISHED_LINK; @@ -358,10 +358,10 @@ After applying this patch, run these commands for a successful build: extern int protocol_version; extern int preserve_times; +extern int preserve_atimes; + extern int in_exit_cleanup; extern int stdout_format_has_i; extern int stdout_format_has_o_or_i; - extern int logfile_format_has_i; -@@ -609,7 +610,8 @@ static void log_formatted(enum logcode c +@@ -615,7 +616,8 @@ 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'; @@ -403,7 +403,7 @@ After applying this patch, run these commands for a successful build: {"omit-dir-times", 'O', POPT_ARG_VAL, &omit_dir_times, 2, 0, 0 }, {"modify-window", 0, POPT_ARG_INT, &modify_window, OPT_MODIFY_WINDOW, 0, 0 }, {"super", 0, POPT_ARG_VAL, &am_root, 2, 0, 0 }, -@@ -1537,6 +1542,8 @@ void server_options(char **args,int *arg +@@ -1531,6 +1536,8 @@ void server_options(char **args,int *arg argstr[x++] = 'D'; if (preserve_times) argstr[x++] = 't'; @@ -513,7 +513,7 @@ After applying this patch, run these commands for a successful build: --super receiver attempts super-user activities -S, --sparse handle sparse files efficiently -n, --dry-run show what would have been transferred -@@ -863,6 +864,12 @@ it is preserving modification times (see +@@ -861,6 +862,12 @@ it is preserving modification times (see the directories on the receiving side, it is a good idea to use bf(-O). This option is inferred if you use bf(--backup) without bf(--backup-dir). @@ -526,7 +526,7 @@ After applying this patch, run these commands for a successful build: dit(bf(--super)) This tells the receiving side to attempt super-user activities even if the receiving rsync wasn't run by the super-user. These activities include: preserving users via the bf(--owner) option, preserving -@@ -1384,7 +1391,7 @@ with older versions of rsync, but that a +@@ -1382,7 +1389,7 @@ with older versions of rsync, but that a verbose messages). The "%i" escape has a cryptic output that is 9 letters long. The general @@ -535,7 +535,7 @@ After applying this patch, run these commands for a successful build: 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 +1431,7 @@ quote(itemize( +@@ -1422,7 +1429,7 @@ quote(itemization( by the file transfer. it() A bf(t) means the modification time is different and is being updated to the sender's value (requires bf(--times)). An alternate value of bf(T) @@ -544,7 +544,7 @@ After applying this patch, run these commands for a successful build: anytime a symlink is transferred, or when a file or device is transferred without bf(--times). it() A bf(p) means the permissions are different and are being updated to -@@ -1433,7 +1440,10 @@ quote(itemize( +@@ -1431,7 +1438,10 @@ quote(itemization( 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). @@ -774,7 +774,7 @@ After applying this patch, run these commands for a successful build: } --- old/util.c +++ new/util.c -@@ -121,7 +121,7 @@ void overflow_exit(char *str) +@@ -121,7 +121,7 @@ NORETURN void overflow_exit(char *str) exit_cleanup(RERR_MALLOC); } diff --git a/threaded-receiver.diff b/threaded-receiver.diff index 33d679a..8a5ea35 100644 --- a/threaded-receiver.diff +++ b/threaded-receiver.diff @@ -26,7 +26,7 @@ After applying this patch, run these commands for a successful build: --- old/Makefile.in +++ new/Makefile.in -@@ -6,7 +6,7 @@ exec_prefix=@exec_prefix@ +@@ -7,7 +7,7 @@ exec_prefix=@exec_prefix@ bindir=@bindir@ mandir=@mandir@ @@ -48,17 +48,17 @@ 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 -@@ -103,9 +99,6 @@ void _exit_cleanup(int code, const char - } - inside_cleanup++; +@@ -98,9 +94,6 @@ NORETURN void _exit_cleanup(int code, co + { + int ocode = code; - SIGACTION(SIGUSR1, SIG_IGN); - SIGACTION(SIGUSR2, SIG_IGN); - + in_exit_cleanup = 1; + if (verbose > 3) { - rprintf(FINFO,"_exit_cleanup(code=%d, file=%s, line=%d): entered\n", - code, file, line); -@@ -137,8 +130,6 @@ void _exit_cleanup(int code, const char +@@ -133,8 +126,6 @@ NORETURN void _exit_cleanup(int code, co io_flush(FULL_FLUSH); if (cleanup_fname) do_unlink(cleanup_fname); @@ -87,7 +87,7 @@ After applying this patch, run these commands for a successful build: extern int protocol_version; extern int fuzzy_basis; extern int always_checksum; -@@ -94,6 +93,11 @@ extern struct filter_list_struct server_ +@@ -95,6 +94,11 @@ extern struct filter_list_struct server_ static int deletion_count = 0; /* used to implement --max-delete */ @@ -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) -@@ -444,8 +448,8 @@ static void sum_sizes_sqroot(struct sum_ +@@ -445,8 +449,8 @@ static void sum_sizes_sqroot(struct sum_ } if (protocol_version < 27) { @@ -110,8 +110,8 @@ After applying this patch, run these commands for a successful build: s2length = SUM_LENGTH; } else { int32 c; -@@ -455,7 +459,7 @@ static void sum_sizes_sqroot(struct sum_ - for (c = blength; c >>= 1 && b; b--) {} +@@ -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 = MAX(s2length, csum_length); @@ -119,7 +119,7 @@ After applying this patch, run these commands for a successful build: s2length = MIN(s2length, SUM_LENGTH); } -@@ -489,7 +493,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); @@ -128,7 +128,7 @@ After applying this patch, run these commands for a successful build: return; if (len > 0) -@@ -508,7 +512,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); @@ -137,7 +137,7 @@ After applying this patch, run these commands for a successful build: continue; } -@@ -1200,7 +1204,7 @@ static void recv_generator(char *fname, +@@ -1205,7 +1209,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) -@@ -1263,7 +1267,7 @@ static void recv_generator(char *fname, +@@ -1268,7 +1272,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; -@@ -1354,9 +1358,12 @@ void generate_files(int f_out, struct fi +@@ -1359,9 +1363,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 = stdout_format_has_i ? 0 : ATTRS_REPORT; -@@ -1384,7 +1391,7 @@ void generate_files(int f_out, struct fi +@@ -1389,7 +1396,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", -@@ -1393,12 +1400,6 @@ void generate_files(int f_out, struct fi +@@ -1398,12 +1405,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]; -@@ -1442,23 +1443,34 @@ void generate_files(int f_out, struct fi +@@ -1447,23 +1448,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 -@@ -1470,27 +1482,43 @@ void generate_files(int f_out, struct fi +@@ -1475,27 +1487,43 @@ void generate_files(int f_out, struct fi phase++; ignore_non_existing = save_ignore_non_existing; ignore_existing = save_ignore_existing; @@ -659,7 +659,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)) { -@@ -841,6 +791,8 @@ static void readfd(int fd, char *buffer, +@@ -847,6 +797,8 @@ static void readfd(int fd, char *buffer, } if (fd == write_batch_monitor_in) { @@ -668,7 +668,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); } -@@ -1102,7 +1054,6 @@ static void writefd_unbuffered(int fd,ch +@@ -1115,7 +1067,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); @@ -676,7 +676,7 @@ After applying this patch, run these commands for a successful build: readfd_unbuffered(sock_f_in, io_filesfrom_buf, sizeof io_filesfrom_buf); } -@@ -1113,7 +1064,7 @@ static void writefd_unbuffered(int fd,ch +@@ -1126,7 +1077,7 @@ static void writefd_unbuffered(int fd,ch defer_forwarding_messages = 1; if (fd == sock_f_out) { @@ -685,7 +685,7 @@ After applying this patch, run these commands for a successful build: last_io_out = time(NULL); sleep_for_bwlimit(cnt); } -@@ -1123,23 +1074,6 @@ static void writefd_unbuffered(int fd,ch +@@ -1136,23 +1087,6 @@ static void writefd_unbuffered(int fd,ch no_flush--; } @@ -709,7 +709,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. -@@ -1165,14 +1099,15 @@ static void mplex_write(enum msgcode cod +@@ -1178,14 +1112,15 @@ static void mplex_write(enum msgcode cod defer_forwarding_messages = 1; writefd_unbuffered(sock_f_out, buf, len); defer_forwarding_messages = 0; @@ -728,7 +728,7 @@ After applying this patch, run these commands for a successful build: if (!iobuf_out_cnt || no_flush) return; -@@ -1186,11 +1121,6 @@ void io_flush(int flush_it_all) +@@ -1199,11 +1134,6 @@ void io_flush(int flush_it_all) static void writefd(int fd,char *buf,size_t len) { @@ -740,7 +740,7 @@ After applying this patch, run these commands for a successful build: if (fd == sock_f_out) stats.total_written += len; -@@ -1396,9 +1326,3 @@ void start_write_batch(int fd) +@@ -1409,9 +1339,3 @@ void start_write_batch(int fd) else write_batch_monitor_in = fd; } @@ -760,7 +760,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; -@@ -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" }, @@ -768,9 +768,9 @@ 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" }, -@@ -242,8 +240,8 @@ void rwrite(enum logcode code, char *buf +@@ -250,8 +248,8 @@ void rwrite(enum logcode code, char *buf if (len < 0) - exit_cleanup(RERR_MESSAGEIO); + EXIT_OR_RETURN(RERR_MESSAGEIO); - if (am_server && msg_fd_out >= 0) { - /* Pass the message to our sibling. */ @@ -789,7 +789,7 @@ After applying this patch, run these commands for a successful build: extern int am_daemon; extern int blocking_io; extern int remove_source_files; -@@ -93,9 +92,20 @@ struct pid_status { +@@ -96,9 +95,20 @@ struct pid_status { static time_t starttime, endtime; static int64 total_read, total_written; @@ -810,7 +810,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) -@@ -172,7 +182,7 @@ static void handle_stats(int f) +@@ -175,7 +185,7 @@ static void handle_stats(int f) show_flist_stats(); } @@ -819,7 +819,7 @@ After applying this patch, run these commands for a successful build: return; if (am_daemon) { -@@ -658,12 +668,30 @@ static void do_server_sender(int f_in, i +@@ -683,12 +693,30 @@ static void do_server_sender(int f_in, i exit_cleanup(0); } @@ -853,7 +853,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. */ -@@ -672,70 +700,16 @@ static int do_recv(int f_in,int f_out,st +@@ -697,70 +725,16 @@ static int do_recv(int f_in,int f_out,st if (preserve_hard_links) init_hard_links(); @@ -929,7 +929,7 @@ After applying this patch, run these commands for a successful build: generate_files(f_out, flist, local_name); handle_stats(-1); -@@ -746,10 +720,13 @@ static int do_recv(int f_in,int f_out,st +@@ -771,10 +745,13 @@ static int do_recv(int f_in,int f_out,st } io_flush(FULL_FLUSH); @@ -947,7 +947,7 @@ After applying this patch, run these commands for a successful build: } -@@ -1151,22 +1128,6 @@ static int start_client(int argc, char * +@@ -1176,22 +1153,6 @@ static int start_client(int argc, char * return ret; } @@ -970,7 +970,7 @@ After applying this patch, run these commands for a successful build: RETSIGTYPE remember_children(UNUSED(int val)) { #ifdef WNOHANG -@@ -1258,8 +1219,6 @@ int main(int argc,char *argv[]) +@@ -1283,8 +1244,6 @@ int main(int argc,char *argv[]) # endif sigact.sa_flags = SA_NOCLDSTOP; #endif @@ -1035,7 +1035,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; -@@ -1305,6 +1305,7 @@ int parse_arguments(int *argc, const cha +@@ -1299,6 +1299,7 @@ int parse_arguments(int *argc, const cha if (do_progress && !verbose && !log_before_transfer && !am_server) verbose = 1; @@ -1074,7 +1074,7 @@ After applying this patch, run these commands for a successful build: extern int log_before_transfer; extern int stdout_format_has_i; extern int logfile_format_has_i; -@@ -154,7 +154,7 @@ static int receive_data(int f_in, char * +@@ -157,7 +157,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) { @@ -1083,7 +1083,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); -@@ -162,7 +162,7 @@ static int receive_data(int f_in, char * +@@ -165,7 +165,7 @@ static int receive_data(int f_in, char * } if (offset < sum.flength) { int32 len = sum.flength - offset; @@ -1092,7 +1092,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; -@@ -175,7 +175,7 @@ static int receive_data(int f_in, char * +@@ -178,7 +178,7 @@ static int receive_data(int f_in, char * } while ((i = recv_token(f_in, &data)) != 0) { @@ -1101,7 +1101,7 @@ After applying this patch, run these commands for a successful build: show_progress(offset, total_size); if (i > 0) { -@@ -245,7 +245,7 @@ static int receive_data(int f_in, char * +@@ -248,7 +248,7 @@ static int receive_data(int f_in, char * ftruncate(fd, offset); #endif @@ -1110,7 +1110,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) { -@@ -296,12 +296,12 @@ static void handle_delayed_updates(struc +@@ -299,12 +299,12 @@ static void handle_delayed_updates(struc "rename failed for %s (from %s)", full_fname(fname), partialptr); } else { @@ -1126,7 +1126,7 @@ After applying this patch, run these commands for a successful build: handle_partial_dir(partialptr, PDIR_DELETE); } } -@@ -352,11 +352,6 @@ int recv_files(int f_in, struct file_lis +@@ -355,11 +355,6 @@ int recv_files(int f_in, struct file_lis if (verbose > 2) rprintf(FINFO,"recv_files(%d) starting\n",flist->count); @@ -1138,7 +1138,7 @@ After applying this patch, run these commands for a successful build: if (delay_updates) delayed_bits = bitbag_create(flist->count); -@@ -377,7 +372,7 @@ int recv_files(int f_in, struct file_lis +@@ -382,7 +377,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); @@ -1147,7 +1147,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) { -@@ -597,7 +592,7 @@ int recv_files(int f_in, struct file_lis +@@ -607,7 +602,7 @@ int recv_files(int f_in, struct file_lis /* log the transfer */ if (log_before_transfer) log_item(FCLIENT, file, &initial_stats, iflags, NULL); @@ -1156,7 +1156,7 @@ After applying this patch, run these commands for a successful build: rprintf(FINFO, "%s\n", fname); /* recv file data */ -@@ -644,11 +639,13 @@ int recv_files(int f_in, struct file_lis +@@ -654,11 +649,13 @@ int recv_files(int f_in, struct file_lis cleanup_disable(); if (recv_ok > 0) { @@ -1172,7 +1172,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) { -@@ -671,8 +668,8 @@ int recv_files(int f_in, struct file_lis +@@ -681,8 +678,8 @@ int recv_files(int f_in, struct file_lis errstr, fname, keptstr, redostr); } if (!phase) { @@ -1193,7 +1193,7 @@ After applying this patch, run these commands for a successful build: extern int am_starting_up; extern int allow_8bit_chars; extern int preserve_uid; -@@ -300,5 +299,5 @@ const char *who_am_i(void) +@@ -305,5 +304,5 @@ const char *who_am_i(void) { if (am_starting_up) return am_server ? "server" : "client"; @@ -1213,7 +1213,7 @@ After applying this patch, run these commands for a successful build: }; #include "errcode.h" -@@ -323,6 +321,7 @@ enum msgcode { +@@ -329,6 +327,7 @@ enum msgcode { #endif #include