From 5823d322c8f699cf934b597579c1365c3997408f Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Mon, 19 Jul 2004 17:17:10 +0000 Subject: [PATCH] Fixed failing hunks. --- g2r-basis-filename.diff | 34 ++++++++++++----------- link-by-hash.diff | 61 ++++++++++++----------------------------- 2 files changed, 35 insertions(+), 60 deletions(-) diff --git a/g2r-basis-filename.diff b/g2r-basis-filename.diff index a7ab07a..15b87d1 100644 --- a/g2r-basis-filename.diff +++ b/g2r-basis-filename.diff @@ -255,7 +255,7 @@ You must run "make proto" before compiling. } if (verbose > 2) ---- orig/main.c 2004-07-17 15:20:05 +--- orig/main.c 2004-07-19 17:14:44 +++ main.c 2004-07-17 15:58:11 @@ -57,6 +57,7 @@ extern int filesfrom_fd; extern pid_t cleanup_child_pid; @@ -334,8 +334,8 @@ You must run "make proto" before compiling. get_redo_num(); /* Read final MSG_DONE and any prior messages. */ report(-1); ---- orig/receiver.c 2004-07-16 20:07:22 -+++ receiver.c 2004-07-17 21:27:55 +--- orig/receiver.c 2004-07-19 17:06:10 ++++ receiver.c 2004-07-19 16:44:39 @@ -28,6 +28,7 @@ extern int max_delete; extern int csum_length; extern struct stats stats; @@ -344,10 +344,10 @@ You must run "make proto" before compiling. extern int am_server; extern int relative_paths; extern int keep_dirlinks; -@@ -299,13 +300,38 @@ static int receive_data(int f_in,struct - return 1; +@@ -303,6 +304,30 @@ static int receive_data(int f_in,struct } + +static char *read_gen_name(int fd, char *buf, char *realname) +{ + int len = read_byte(fd); @@ -371,8 +371,11 @@ You must run "make proto" before compiling. + return realname; +} + - - /** ++ + static void discard_receive_data(int f_in, OFF_T length) + { + receive_data(f_in, NULL, -1, NULL, length); +@@ -313,8 +338,10 @@ static void discard_receive_data(int f_i * main routine for receiver process. * * Receiver process runs on the same host as the generator process. */ @@ -384,7 +387,7 @@ You must run "make proto" before compiling. int fd1,fd2; STRUCT_STAT st; char *fname, fbuf[MAXPATHLEN]; -@@ -332,8 +358,20 @@ int recv_files(int f_in, struct file_lis +@@ -341,6 +368,17 @@ int recv_files(int f_in, struct file_lis i = read_int(f_in); if (i == -1) { @@ -401,11 +404,8 @@ You must run "make proto" before compiling. + if (phase) break; -+ - phase = 1; - csum_length = SUM_LENGTH; - if (verbose > 2) -@@ -373,19 +411,31 @@ int recv_files(int f_in, struct file_lis + +@@ -383,7 +421,26 @@ int recv_files(int f_in, struct file_lis if (verbose > 2) rprintf(FINFO,"recv_files(%s)\n",fname); @@ -418,9 +418,9 @@ You must run "make proto" before compiling. + next_gen_i = read_int(f_name_in); + } + if (i < next_gen_i) { -+ rprintf(FINFO, "skipping update for %s\n", ++ rprintf(FINFO, "skipping update for \"%s\"\n", + fname); -+ receive_data(f_in,NULL,-1,NULL,file->length); ++ discard_receive_data(f_in, file->length); + continue; + } + next_gen_i = -1; @@ -430,8 +430,10 @@ You must run "make proto" before compiling. + fnamecmp = read_gen_name(f_name_in, fnamecmpbuf, fname); + else + fnamecmp = fname; -+ + if (server_exclude_list.head + && check_exclude(&server_exclude_list, fname, +@@ -400,14 +457,6 @@ int recv_files(int f_in, struct file_lis /* open the file */ fd1 = do_open(fnamecmp, O_RDONLY, 0); diff --git a/link-by-hash.diff b/link-by-hash.diff index 66d442c..202c100 100644 --- a/link-by-hash.diff +++ b/link-by-hash.diff @@ -434,8 +434,8 @@ the file's name. if (files_from && (!am_sender || remote_filesfrom_file)) { if (remote_filesfrom_file) { args[ac++] = "--files-from"; ---- orig/receiver.c 2004-07-16 20:07:22 -+++ receiver.c 2004-07-16 20:16:37 +--- orig/receiver.c 2004-07-19 17:06:10 ++++ receiver.c 2004-07-19 17:07:31 @@ -37,6 +37,7 @@ extern int cvs_exclude; extern int io_error; extern char *tmpdir; @@ -444,7 +444,7 @@ the file's name. extern int make_backups; extern int do_progress; extern char *backup_dir; -@@ -197,10 +198,11 @@ static int get_tmpname(char *fnametmp, c +@@ -200,10 +201,11 @@ static int get_tmpname(char *fnametmp, c static int receive_data(int f_in,struct map_struct *mapbuf,int fd,char *fname, @@ -457,7 +457,7 @@ the file's name. unsigned int len; OFF_T offset = 0; OFF_T offset2; -@@ -211,6 +213,9 @@ static int receive_data(int f_in,struct +@@ -214,6 +216,9 @@ static int receive_data(int f_in,struct read_sum_head(f_in, &sum); @@ -467,7 +467,7 @@ the file's name. sum_init(checksum_seed); while ((i = recv_token(f_in, &data)) != 0) { -@@ -227,6 +232,8 @@ static int receive_data(int f_in,struct +@@ -230,6 +235,8 @@ static int receive_data(int f_in,struct cleanup_got_literal = 1; sum_update(data,i); @@ -476,7 +476,7 @@ the file's name. if (fd != -1 && write_file(fd,data,i) != i) { rsyserr(FERROR, errno, "write failed on %s", -@@ -254,6 +261,8 @@ static int receive_data(int f_in,struct +@@ -257,6 +264,8 @@ static int receive_data(int f_in,struct see_token(map, len); sum_update(map,len); @@ -485,7 +485,7 @@ the file's name. } if (!inplace || offset != offset2) { -@@ -290,6 +299,8 @@ static int receive_data(int f_in,struct +@@ -293,6 +302,8 @@ static int receive_data(int f_in,struct } sum_end(file_sum1); @@ -494,43 +494,16 @@ the file's name. read_buf(f_in,file_sum2,MD4_SUM_LENGTH); if (verbose > 2) -@@ -389,7 +400,7 @@ int recv_files(int f_in, struct file_lis - if (fd1 != -1 && do_fstat(fd1,&st) != 0) { - rsyserr(FERROR, errno, "fstat %s failed", - full_fname(fnamecmp)); -- receive_data(f_in,NULL,-1,NULL,file->length); -+ receive_data(f_in,NULL,-1,NULL,file->length,NULL); - close(fd1); - continue; - } -@@ -402,7 +413,7 @@ int recv_files(int f_in, struct file_lis - */ - rprintf(FERROR,"recv_files: %s is a directory\n", - full_fname(fnamecmp)); -- receive_data(f_in, NULL, -1, NULL, file->length); -+ receive_data(f_in,NULL,-1,NULL,file->length,NULL); - close(fd1); - continue; - } -@@ -435,7 +446,7 @@ int recv_files(int f_in, struct file_lis - if (fd2 == -1) { - rsyserr(FERROR, errno, "open %s failed", - full_fname(fnamecmp)); -- receive_data(f_in,mapbuf,-1,NULL,file->length); -+ receive_data(f_in,mapbuf,-1,NULL,file->length,NULL); - if (mapbuf) - unmap_file(mapbuf); - if (fd1 != -1) -@@ -472,7 +483,7 @@ int recv_files(int f_in, struct file_lis - if (fd2 == -1) { - rsyserr(FERROR, errno, "mkstemp %s failed", - full_fname(fnametmp)); -- receive_data(f_in,mapbuf,-1,NULL,file->length); -+ receive_data(f_in,mapbuf,-1,NULL,file->length,NULL); - if (mapbuf) - unmap_file(mapbuf); - if (fd1 != -1) -@@ -487,7 +498,11 @@ int recv_files(int f_in, struct file_lis +@@ -305,7 +316,7 @@ static int receive_data(int f_in,struct + + static void discard_receive_data(int f_in, OFF_T length) + { +- receive_data(f_in, NULL, -1, NULL, length); ++ receive_data(f_in, NULL, -1, NULL, length, NULL); + } + + +@@ -510,7 +521,11 @@ int recv_files(int f_in, struct file_lis rprintf(FINFO, "%s\n", fname); /* recv file data */ -- 2.34.1