From: Wayne Davison Date: Thu, 23 Sep 2004 15:41:04 +0000 (+0000) Subject: - Reject --fuzzy if combined with --inplace. X-Git-Url: https://mattmccutchen.net/rsync/rsync-patches.git/commitdiff_plain/dd39e6572757ca9e7aad8e2406356f3145c9adef - Reject --fuzzy if combined with --inplace. - Got rid of some "might be used uninitialized" compiler warnings. --- diff --git a/fuzzy.diff b/fuzzy.diff index 2790312..5b442a5 100644 --- a/fuzzy.diff +++ b/fuzzy.diff @@ -7,7 +7,7 @@ Very lightly tested. Be sure to run "make proto" before "make". --- orig/generator.c 2004-09-20 19:57:58 -+++ generator.c 2004-07-30 18:11:15 ++++ generator.c 2004-09-23 15:33:08 @@ -43,6 +43,7 @@ extern int ignore_times; extern int size_only; extern int io_timeout; @@ -16,7 +16,7 @@ Be sure to run "make proto" before "make". extern int always_checksum; extern char *partial_dir; extern char *compare_dest; -@@ -244,6 +245,93 @@ static void generate_and_send_sums(int f +@@ -244,6 +245,92 @@ static void generate_and_send_sums(int f } @@ -71,8 +71,7 @@ Be sure to run "make proto" before "make". + } + + /* Get final extension, eg. .gz; never full basename though. */ -+ ext = strrchr(basename + 1, '.'); -+ if (!ext) ++ if (!(ext = strrchr(basename + 1, '.'))) + ext = basename + strlen(basename); /* ext = "" */ + + while ((di = readdir(d)) != NULL) { @@ -110,7 +109,22 @@ Be sure to run "make proto" before "make". /* * Acts on file number @p i from @p flist, whose name is @p fname. -@@ -468,6 +556,15 @@ static void recv_generator(char *fname, +@@ -256,11 +343,11 @@ static void generate_and_send_sums(int f + static void recv_generator(char *fname, struct file_struct *file, int i, + int f_out, int f_out_name) + { +- int fd = -1, f_copy; ++ int fd = -1, f_copy = -1; + STRUCT_STAT st, partial_st; +- struct file_struct *back_file; ++ struct file_struct *back_file = NULL; + int statret, stat_errno; +- char *fnamecmp, *partialptr, *backupptr; ++ char *fnamecmp, *partialptr, *backupptr = NULL; + char fnamecmpbuf[MAXPATHLEN]; + uchar fnamecmp_type; + +@@ -468,6 +555,15 @@ static void recv_generator(char *fname, } else partialptr = NULL; @@ -126,7 +140,7 @@ Be sure to run "make proto" before "make". if (statret == -1) { if (preserve_hard_links && hard_link_check(file, HL_SKIP)) return; -@@ -494,7 +591,7 @@ static void recv_generator(char *fname, +@@ -494,7 +590,7 @@ static void recv_generator(char *fname, return; } @@ -135,7 +149,18 @@ Be sure to run "make proto" before "make". if (fnamecmp_type == G2R_FNAME) set_perms(fname, file, &st, PERMS_REPORT); return; -@@ -570,6 +667,21 @@ prepare_to_open: +@@ -553,10 +649,6 @@ prepare_to_open: + return; + } + fnamecmp_type = G2R_BACKUP; +- } else { +- backupptr = NULL; +- back_file = NULL; +- f_copy = -1; + } + + if (verbose > 3) { +@@ -570,6 +662,21 @@ prepare_to_open: notify_others: if (f_out_name >= 0) { write_byte(f_out_name, fnamecmp_type); @@ -176,8 +201,8 @@ Be sure to run "make proto" before "make". /* The receiving side mustn't obey this, or an existing symlink that * points to an identical file won't be replaced by the referent. */ ---- orig/options.c 2004-09-20 05:10:48 -+++ options.c 2004-07-16 20:14:12 +--- orig/options.c 2004-09-22 08:47:31 ++++ options.c 2004-09-23 14:59:46 @@ -85,6 +85,7 @@ int safe_symlinks = 0; int copy_unsafe_links = 0; int size_only = 0; @@ -202,7 +227,19 @@ Be sure to run "make proto" before "make". /* TODO: Should this take an optional int giving the compression level? */ {"compress", 'z', POPT_ARG_NONE, &do_compression, 0, 0, 0 }, {"daemon", 0, POPT_ARG_NONE, &daemon_opt, 0, 0, 0 }, -@@ -1095,6 +1098,9 @@ void server_options(char **args,int *arg +@@ -833,6 +836,11 @@ int parse_arguments(int *argc, const cha + link_dest ? "--link-dest" : "--compare-dest"); + return 0; + } ++ if (compare_dest) { ++ snprintf(err_buf, sizeof err_buf, ++ "--inplace does not yet work with --fuzzy\n"); ++ return 0; ++ } + } else { + if (keep_partial && !partial_dir) + partial_dir = getenv("RSYNC_PARTIAL_DIR"); +@@ -1099,6 +1107,9 @@ void server_options(char **args,int *arg } } @@ -255,7 +292,7 @@ Be sure to run "make proto" before "make". compare_dest, fname); --- orig/rsync.h 2004-09-07 21:52:22 +++ rsync.h 2004-09-07 22:02:37 -@@ -121,6 +121,7 @@ +@@ -122,6 +122,7 @@ #define G2R_FNAME 0x80 #define G2R_PARTIAL_DIR 0x81 #define G2R_BACKUP 0x82 @@ -263,7 +300,7 @@ Be sure to run "make proto" before "make". /* Log-message categories. FLOG is only used on the daemon side to ---- orig/rsync.yo 2004-09-20 05:10:48 +--- orig/rsync.yo 2004-09-22 08:47:31 +++ rsync.yo 2004-07-03 19:27:25 @@ -356,6 +356,7 @@ verb( -T --temp-dir=DIR create temporary files in directory DIR