X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/ddaef70cede8b8ed24b084b93208a2353745b1bd..7bc595785ee6ac59fe514fd84ddc6d3a3c44e587:/generator.c diff --git a/generator.c b/generator.c index 909c0f4d..10500a99 100644 --- a/generator.c +++ b/generator.c @@ -279,7 +279,7 @@ static enum delret delete_dir_contents(char *fname, uint16 flags) for (j = dirlist->used; j--; ) { struct file_struct *fp = dirlist->files[j]; - if (fp->flags & FLAG_MOUNT_DIR) { + if (fp->flags & FLAG_MOUNT_DIR && S_ISDIR(fp->mode)) { if (verbose > 1) { rprintf(FINFO, "mount point, %s, pins parent directory\n", @@ -511,7 +511,7 @@ static void delete_in_dir(char *fbuf, struct file_struct *file, dev_t *fs_dev) struct file_struct *fp = dirlist->files[i]; if (!F_IS_ACTIVE(fp)) continue; - if (fp->flags & FLAG_MOUNT_DIR) { + if (fp->flags & FLAG_MOUNT_DIR && S_ISDIR(fp->mode)) { if (verbose > 1) rprintf(FINFO, "cannot delete mount point: %s\n", f_name(fp, NULL)); @@ -1743,9 +1743,6 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx, goto cleanup; } - if (append_mode > 0 && sx.st.st_size >= F_LENGTH(file)) - goto cleanup; - if (fnamecmp_type <= FNAMECMP_BASIS_DIR_HIGH) ; else if (fnamecmp_type == FNAMECMP_FUZZY) @@ -1770,6 +1767,10 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx, goto cleanup; } + if (append_mode > 0 && sx.st.st_size >= F_LENGTH(file)) { + goto cleanup; + } + prepare_to_open: if (partialptr) { sx.st = partial_st;