+ if (only_existing && statret == -1 && errno == ENOENT) {
+ /* we only want to update existing files */
+ if (verbose > 1) rprintf(FINFO, RSYNC_NAME
+ ": not creating new file \"%s\"\n",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
+ presmissions then act as though the remote end sent
+ us the file permissions we already have */
+ file->mode = (file->mode & _S_IFMT) | (st.st_mode & ~_S_IFMT);
+ }
+