From 7684ebda546cb7f9944704f77e169b5b3b12688c Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Thu, 29 Jul 2004 16:07:23 +0000 Subject: [PATCH] Optimize the --partial-dir=. option (which is the same as just specifying --partial). --- partial-dir.diff | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/partial-dir.diff b/partial-dir.diff index 2a3c4c2..50610f3 100644 --- a/partial-dir.diff +++ b/partial-dir.diff @@ -86,17 +86,18 @@ You must run "make proto" after applying this patch. keep_partial = 0; #else snprintf(err_buf, sizeof err_buf, -@@ -777,7 +787,8 @@ int parse_arguments(int *argc, const cha +@@ -777,6 +787,10 @@ int parse_arguments(int *argc, const cha am_server ? "server" : "client"); return 0; #endif -- } -+ } else if (partial_dir) ++ } else if (partial_dir) { ++ if (strcmp(partial_dir, ".") == 0) ++ partial_dir = NULL; + keep_partial = 1; + } if (files_from) { - char *colon; -@@ -969,7 +980,10 @@ void server_options(char **args,int *arg +@@ -969,7 +983,10 @@ void server_options(char **args,int *arg args[ac++] = arg; } @@ -118,7 +119,7 @@ You must run "make proto" after applying this patch. extern char *compare_dest; extern int make_backups; extern int do_progress; -@@ -342,7 +343,7 @@ int recv_files(int f_in, struct file_lis +@@ -340,7 +341,7 @@ int recv_files(int f_in, struct file_lis char *fname, fbuf[MAXPATHLEN]; char template[MAXPATHLEN]; char fnametmp[MAXPATHLEN]; @@ -127,7 +128,7 @@ You must run "make proto" after applying this patch. char fnamecmpbuf[MAXPATHLEN]; struct file_struct *file; struct stats initial_stats; -@@ -410,8 +411,6 @@ int recv_files(int f_in, struct file_lis +@@ -408,8 +409,6 @@ int recv_files(int f_in, struct file_lis if (verbose > 2) rprintf(FINFO, "recv_files(%s)\n", safe_fname(fname)); @@ -136,7 +137,7 @@ You must run "make proto" after applying this patch. if (read_batch) { while (i > next_gen_i) { next_gen_i = read_int(batch_gen_fd); -@@ -438,9 +437,22 @@ int recv_files(int f_in, struct file_lis +@@ -436,9 +435,22 @@ int recv_files(int f_in, struct file_lis continue; } @@ -159,7 +160,7 @@ You must run "make proto" after applying this patch. if (fd1 == -1 && compare_dest != NULL) { /* try the file at compare_dest instead */ pathjoin(fnamecmpbuf, sizeof fnamecmpbuf, -@@ -528,7 +540,8 @@ int recv_files(int f_in, struct file_lis +@@ -526,7 +538,8 @@ int recv_files(int f_in, struct file_lis continue; } @@ -169,7 +170,7 @@ You must run "make proto" after applying this patch. } if (!am_server && verbose) /* log the transfer */ -@@ -548,10 +561,20 @@ int recv_files(int f_in, struct file_lis +@@ -546,10 +559,20 @@ int recv_files(int f_in, struct file_lis exit_cleanup(RERR_FILEIO); } @@ -192,7 +193,7 @@ You must run "make proto" after applying this patch. cleanup_disable(); -@@ -559,9 +582,13 @@ int recv_files(int f_in, struct file_lis +@@ -557,9 +580,13 @@ int recv_files(int f_in, struct file_lis int msgtype = csum_length == SUM_LENGTH || read_batch ? FERROR : FINFO; if (msgtype == FERROR || verbose) { @@ -209,7 +210,7 @@ You must run "make proto" after applying this patch. if (msgtype == FERROR) { errstr = "ERROR"; redostr = ""; -@@ -570,7 +597,7 @@ int recv_files(int f_in, struct file_lis +@@ -568,7 +595,7 @@ int recv_files(int f_in, struct file_lis redostr = " (will try again)"; } rprintf(msgtype, -- 2.34.1