X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/1b2d733af23599b2cc173c8a275b895760f66258..a16bbc3990cc3c9ef1228508246f9f6840d9ffa2:/rsync.c diff --git a/rsync.c b/rsync.c index cf57296a..c1ce0b5c 100644 --- a/rsync.c +++ b/rsync.c @@ -561,7 +561,7 @@ static int receive_data(int f_in,struct map_struct *buf,int fd,char *fname) sum_update(data,i); - if (fd != -1 && write_sparse(fd,data,i) != i) { + if (fd != -1 && write_file(fd,data,i) != i) { fprintf(FERROR,"write failed on %s : %s\n",fname,strerror(errno)); exit_cleanup(1); } @@ -582,7 +582,7 @@ static int receive_data(int f_in,struct map_struct *buf,int fd,char *fname) see_token(map, len); sum_update(map,len); - if (fd != -1 && write_sparse(fd,map,len) != len) { + if (fd != -1 && write_file(fd,map,len) != len) { fprintf(FERROR,"write failed on %s : %s\n",fname,strerror(errno)); exit_cleanup(1); } @@ -649,6 +649,8 @@ static int delete_already_done(struct file_list *flist,int j) exit_cleanup(1); } + name[strlen(name)-2] = 0; + p = strrchr(name,'/'); if (!p) { free(name); @@ -656,6 +658,8 @@ static int delete_already_done(struct file_list *flist,int j) } *p = 0; + strcat(name,"/."); + while (low != high) { int mid = (low+high)/2; int ret = strcmp(f_name(flist->files[flist_up(flist, mid)]),name); @@ -703,6 +707,8 @@ static void delete_files(struct file_list *flist) if (!S_ISDIR(flist->files[j]->mode)) continue; + if (strlen(name)<2 || strcmp(name+strlen(name)-2,"/.")!=0) continue; + if (delete_already_done(flist, j)) continue; if (!(local_file_list = send_file_list(-1,1,&name)))