From cc1e997dcdf69d5346a6aed7b8ef10f5309202f8 Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Wed, 23 Jun 2004 16:51:21 +0000 Subject: [PATCH] Thought skip_file() wasn't returning 1 for "skip" and 0 or "keep" so I reversed the return. --- generator.c | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/generator.c b/generator.c index a804ca9f..5884ee49 100644 --- a/generator.c +++ b/generator.c @@ -60,20 +60,19 @@ extern struct exclude_list_struct server_exclude_list; /* choose whether to skip a particular file */ static int skip_file(char *fname, struct file_struct *file, STRUCT_STAT *st) { - if (st->st_size != file->length) { - return 0; - } + if (st->st_size != file->length) + return 1; if (link_dest) { if (preserve_perms && (st->st_mode & CHMOD_BITS) != (file->mode & CHMOD_BITS)) - return 0; + return 1; if (am_root && preserve_uid && st->st_uid != file->uid) - return 0; + return 1; if (preserve_gid && file->gid != GID_NONE && st->st_gid != file->gid) - return 0; + return 1; } /* if always checksum is set then we use the checksum instead @@ -91,18 +90,16 @@ static int skip_file(char *fname, struct file_struct *file, STRUCT_STAT *st) } file_checksum(fname,sum,st->st_size); return memcmp(sum, file->u.sum, protocol_version < 21 ? 2 - : MD4_SUM_LENGTH) == 0; + : MD4_SUM_LENGTH) != 0; } - if (size_only) { - return 1; - } - - if (ignore_times) { + if (size_only) return 0; - } - return (cmp_modtime(st->st_mtime,file->modtime) == 0); + if (ignore_times) + return 1; + + return cmp_modtime(st->st_mtime, file->modtime) != 0; } @@ -491,7 +488,7 @@ void recv_generator(char *fname, struct file_struct *file, int i, int f_out) return; } - if (skip_file(fname, file, &st)) { + if (!skip_file(fname, file, &st)) { if (fnamecmp == fname) set_perms(fname, file, &st, PERMS_REPORT); return; -- 2.34.1