X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/ac1eb754b84f74eaba1663a07f7ff068bd280ce6..720b47f2611d277684b2ec35d11dc3feedb207fe:/rsync.c diff --git a/rsync.c b/rsync.c index 66e42a3a..9f1d80ab 100644 --- a/rsync.c +++ b/rsync.c @@ -486,8 +486,9 @@ int recv_files(int f_in,struct file_list *flist,char *local_name) char *buf; int i; - if (verbose > 2) + if (verbose > 2) { fprintf(stderr,"recv_files(%d) starting\n",flist->count); + } if (recurse && delete_mode && !local_name && flist->count>0) { delete_files(flist); @@ -560,7 +561,10 @@ int recv_files(int f_in,struct file_list *flist,char *local_name) /* recv file data */ receive_data(f_in,buf,fd2,fname); - if (fd1 != -1) close(fd1); + if (fd1 != -1) { + unmap_file(buf,st.st_size); + close(fd1); + } close(fd2); if (verbose > 2) @@ -583,8 +587,6 @@ int recv_files(int f_in,struct file_list *flist,char *local_name) cleanup_fname = NULL; - unmap_file(buf,st.st_size); - set_perms(fname,&flist->files[i],NULL,0); } @@ -609,6 +611,8 @@ off_t send_files(struct file_list *flist,int f_out,int f_in) if (verbose > 2) fprintf(stderr,"send_files starting\n"); + setup_nonblocking(f_in,f_out); + while (1) { i = read_int(f_in);