rem: if (update_only && fnamecmp == fname
add: if (update_only && fnamecmp_type == FNAMECMP_FNAME
context: static void recv_generator(char *fname, struct file_struct *file, int i,			   int f_out){	int fd, f_copy;	STRUCT_STAT st, partial_st;	struct file_struct *back_file;	int statret, stat_errno;	char *fnamecmp, *partialptr, *backupptr;	char fnamecmpbuf[MAXPATHLEN];	if (list_only)		return;	if (verbose > 2)		rprintf(FINFO, "recv_generator(%s,%d)\n", safe_fname(fname), i);	if (server_exclude_list.head	    && check_exclude(&server_exclude_list, fname,			     S_ISDIR(file->mode)) < 0) {		if (verbose) {			rprintf(FINFO, "skipping server-excluded file \"%s\"\n",				safe_fname(fname));		}		return;	}	if (dry_run > 1) {		statret = -1;		stat_errno = ENOENT;	} else {		statret = link_stat(fname, &st,				    keep_dirlinks && S_ISDIR(file->mode));		stat_errno = errno;	}	if (only_existing && statret == -1 && stat_errno == ENOENT) {		/* we only want to update existing files */		if (verbose > 1) {			rprintf(FINFO, "not creating new file \"%s\"\n",				safe_fname(fname));		}		return;	}	if (statret == 0 && !preserve_perms	    && S_ISDIR(st.st_mode) == S_ISDIR(file->mode)) {		/* if the file exists already and we aren't perserving		 * permissions then act as though the remote end sent		 * us the file permissions we already have */		file->mode = (file->mode & ~CHMOD_BITS)			   | (st.st_mode & CHMOD_BITS);	}	if (S_ISDIR(file->mode)) {		/* The file to be received is a directory, so we need		 * to prepare appropriately.  If there is already a		 * file of that name and it is *not* a directory, then		 * we need to delete it.  If it doesn't exist, then		 * recursively create it. */		if (dry_run)			return; /* TODO: causes inaccuracies -- fix */		if (statret == 0 && !S_ISDIR(st.st_mode)) {			if (robust_unlink(fname) != 0) {				rsyserr(FERROR, errno,					"recv_generator: unlink %s to make room for directory",					full_fname(fname));				return;			}			statret = -1;		}		if (statret != 0 && do_mkdir(fname,file->mode) != 0 && errno != EEXIST) {			if (!(relative_paths && errno == ENOENT			    && create_directory_path(fname, orig_umask) == 0			    && do_mkdir(fname, file->mode) == 0)) {				rsyserr(FERROR, errno,					"recv_generator: mkdir %s failed",					full_fname(fname));			}		}		/* f_out is set to -1 when doing final directory-permission		 * and modification-time repair. */		if (set_perms(fname, file, statret ? NULL : &st, 0)		    && verbose && f_out != -1)			rprintf(FINFO, "%s/\n", safe_fname(fname));		return;	}	if (preserve_links && S_ISLNK(file->mode)) {#if SUPPORT_LINKS		char lnk[MAXPATHLEN];		int l;		if (safe_symlinks && unsafe_symlink(file->u.link, fname)) {			if (verbose) {				rprintf(FINFO, "ignoring unsafe symlink %s -> \"%s\"\n",					full_fname(fname), file->u.link);			}			return;		}		if (statret == 0) {			l = readlink(fname,lnk,MAXPATHLEN-1);			if (l > 0) {				lnk[l] = 0;				/* A link already pointing to the				 * right place -- no further action				 * required. */				if (strcmp(lnk,file->u.link) == 0) {					set_perms(fname, file, &st,						  PERMS_REPORT);					return;				}			}			/* Not a symlink, so delete whatever's			 * already there and put a new symlink			 * in place. */			delete_file(fname);		}		if (do_symlink(file->u.link,fname) != 0) {			rsyserr(FERROR, errno, "symlink %s -> \"%s\" failed",				full_fname(fname), safe_fname(file->u.link));		} else {			set_perms(fname,file,NULL,0);			if (verbose) {				rprintf(FINFO, "%s -> %s\n", safe_fname(fname),					safe_fname(file->u.link));			}		}#endif		return;	}	if (am_root && preserve_devices && IS_DEVICE(file->mode)) {		if (statret != 0 ||		    st.st_mode != file->mode ||		    st.st_rdev != file->u.rdev) {			delete_file(fname);			if (verbose > 2) {				rprintf(FINFO,"mknod(%s,0%o,0x%x)\n",					safe_fname(fname),					(int)file->mode, (int)file->u.rdev);			}			if (do_mknod(fname,file->mode,file->u.rdev) != 0) {				rsyserr(FERROR, errno, "mknod %s failed",					full_fname(fname));			} else {				set_perms(fname,file,NULL,0);				if (verbose) {					rprintf(FINFO, "%s\n",						safe_fname(fname));				}			}		} else {			set_perms(fname, file, &st, PERMS_REPORT);		}		return;	}	if (preserve_hard_links && hard_link_check(file, HL_CHECK_MASTER))		return;	if (!S_ISREG(file->mode)) {		rprintf(FINFO, "skipping non-regular file \"%s\"\n",			safe_fname(fname));		return;	}	fnamecmp = fname;	if (statret == -1 && compare_dest != NULL) {		/* try the file at compare_dest instead */		pathjoin(fnamecmpbuf, sizeof fnamecmpbuf, compare_dest, fname);		if (link_stat(fnamecmpbuf, &st, 0) == 0		    && S_ISREG(st.st_mode)) {#if HAVE_LINK			if (link_dest && !dry_run) {				if (do_link(fnamecmpbuf, fname) < 0) {					if (verbose) {						rsyserr(FINFO, errno,							"link %s => %s",							fnamecmpbuf,							safe_fname(fname));					}					fnamecmp = fnamecmpbuf;				}			} else#endif				fnamecmp = fnamecmpbuf;			statret = 0;		}	}	if (statret == 0 && !S_ISREG(st.st_mode)) {		if (delete_file(fname) != 0)			return;		statret = -1;		stat_errno = ENOENT;	}	if (partial_dir && (partialptr = partial_dir_fname(fname))	    && link_stat(partialptr, &partial_st, 0) == 0	    && S_ISREG(partial_st.st_mode)) {		if (statret == -1)			goto prepare_to_open;	} else		partialptr = NULL;	if (statret == -1) {		if (preserve_hard_links && hard_link_check(file, HL_SKIP))			return;		if (stat_errno == ENOENT) {			write_int(f_out,i);			if (!dry_run && !read_batch)				write_sum_head(f_out, NULL);		} else if (verbose > 1) {			rsyserr(FERROR, stat_errno,				"recv_generator: failed to stat %s",				full_fname(fname));		}		return;	}	if (opt_ignore_existing && fnamecmp == fname) {		if (verbose > 1)			rprintf(FINFO, "%s exists\n", safe_fname(fname));		return;	}	if (update_only && fnamecmp == fname	    && cmp_modtime(st.st_mtime, file->modtime) > 0) {		if (verbose > 1)			rprintf(FINFO, "%s is newer\n", safe_fname(fname));		return;	}	if (skip_file(fnamecmp, file, &st)) {		if (fnamecmp == fname)			set_perms(fname, file, &st, PERMS_REPORT);		return;	}prepare_to_open:	if (dry_run || read_batch) {		write_int(f_out,i);		return;	}	if (whole_file > 0) {		write_int(f_out,i);		write_sum_head(f_out, NULL);		return;	}	if (partialptr) {		st = partial_st;		fnamecmp = partialptr;	}	/* open the file */	fd = do_open(fnamecmp, O_RDONLY, 0);	if (fd == -1) {		rsyserr(FERROR, errno, "failed to open %s, continuing",			full_fname(fnamecmp));	    pretend_missing:		/* pretend the file didn't exist */		if (preserve_hard_links && hard_link_check(file, HL_SKIP))			return;		write_int(f_out,i);		write_sum_head(f_out, NULL);		return;	}	if (inplace && make_backups) {		if (!(backupptr = get_backup_name(fname))) {			close(fd);			return;		}		if (!(back_file = make_file(fname, NULL, NO_EXCLUDES))) {			close(fd);			goto pretend_missing;		}		if (robust_unlink(backupptr) && errno != ENOENT) {			rsyserr(FERROR, errno, "unlink %s",				full_fname(backupptr));			free(back_file);			close(fd);			return;		}		if ((f_copy = do_open(backupptr,		    O_WRONLY | O_CREAT | O_TRUNC | O_EXCL, 0600)) < 0) {			rsyserr(FERROR, errno, "open %s",				full_fname(backupptr));			free(back_file);			close(fd);			return;		}	} else {		backupptr = NULL;		back_file = NULL;		f_copy = -1;	}	if (verbose > 3) {		rprintf(FINFO, "gen mapped %s of size %.0f\n",			safe_fname(fnamecmp), (double)st.st_size);	}	if (verbose > 2)		rprintf(FINFO, "generating and sending sums for %d\n", i);	write_int(f_out,i);	generate_and_send_sums(fd, st.st_size, f_out, f_copy);	if (f_copy >= 0) {		close(f_copy);		set_perms(backupptr, back_file, NULL, 0);		if (verbose > 1)			rprintf(FINFO, "backed up %s to %s\n", fname, backupptr);		free(back_file);	}	close(fd);}