X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/a5c11139717c41030c9d33617f3b255481afd3fa..aa0b9ca174023a4f9b0cfc830a76b6e170982203:/options.c diff --git a/options.c b/options.c index 2e27d106..5db7d62c 100644 --- a/options.c +++ b/options.c @@ -88,6 +88,7 @@ int max_delete = 0; int ignore_errors = 0; int modify_window = 0; int blocking_io = -1; +int checksum_seed = 0; unsigned int block_size = 0; @@ -125,6 +126,7 @@ int quiet = 0; int always_checksum = 0; int list_only = 0; +#define FIXED_CHECKSUM_SEED 32761 #define MAX_BATCH_PREFIX_LEN 256 /* Must be less than MAXPATHLEN-13 */ char *batch_prefix = NULL; @@ -418,11 +420,13 @@ static int check_refuse_options(char *ref, int opt) char *p; const char *name; - for (i=0; long_options[i].longName; i++) { - if (long_options[i].val == opt) break; + for (i = 0; long_options[i].longName; i++) { + if (long_options[i].val == opt) + break; } - if (!long_options[i].longName) return 0; + if (!long_options[i].longName) + return 0; name = long_options[i].longName; len = strlen(name); @@ -472,9 +476,8 @@ int parse_arguments(int *argc, const char ***argv, int frommain) pc = poptGetContext(RSYNC_NAME, *argc, *argv, long_options, 0); while ((opt = poptGetNextOpt(pc)) != -1) { - if (ref) { - if (check_refuse_options(ref, opt)) return 0; - } + if (ref && check_refuse_options(ref, opt)) + return 0; /* most options are handled automatically by popt; * only special cases are returned and listed here. */ @@ -530,7 +533,8 @@ int parse_arguments(int *argc, const char ***argv, int frommain) break; case 'q': - if (frommain) quiet++; + if (frommain) + quiet++; break; case OPT_SENDER: @@ -549,11 +553,13 @@ int parse_arguments(int *argc, const char ***argv, int frommain) case OPT_WRITE_BATCH: /* popt stores the filename in batch_prefix for us */ write_batch = 1; + checksum_seed = FIXED_CHECKSUM_SEED; break; case OPT_READ_BATCH: /* popt stores the filename in batch_prefix for us */ read_batch = 1; + checksum_seed = FIXED_CHECKSUM_SEED; break; case OPT_LINK_DEST: @@ -720,13 +726,7 @@ void server_options(char **args,int *argc) { int ac = *argc; static char argstr[50]; - static char bsize[30]; - static char iotime[30]; - static char mdelete[30]; - static char mwindow[30]; - static char bw[50]; - /* Leave room for ``--(write|read)-batch='' */ - static char fext[MAX_BATCH_PREFIX_LEN + 15]; + char *arg; int i, x; @@ -747,7 +747,7 @@ void server_options(char **args,int *argc) x = 1; argstr[0] = '-'; - for (i=0;i