X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/7c2a9e766c0e162773b291b916521297f24d57c4..d5c973ccb7da1bc87c5caa5d5ac594bc217016f7:/main.c diff --git a/main.c b/main.c index c6bd2c29..629eb35b 100644 --- a/main.c +++ b/main.c @@ -85,7 +85,7 @@ static void report(int f) extern int remote_version; int send_stats; - if (do_stats) { + if (do_stats && verbose > 1) { /* These come out from every process */ show_malloc_stats(); show_flist_stats(); @@ -142,12 +142,12 @@ static void report(int f) rprintf(FINFO,"File list size: %d\n", stats.flist_size); rprintf(FINFO,"Total bytes written: %.0f\n", (double)stats.total_written); - rprintf(FINFO,"Total bytes read: %.0f\n\n", + rprintf(FINFO,"Total bytes read: %.0f\n", (double)stats.total_read); } if (verbose || do_stats) { - rprintf(FINFO,"wrote %.0f bytes read %.0f bytes %.2f bytes/sec\n", + rprintf(FINFO,"\nwrote %.0f bytes read %.0f bytes %.2f bytes/sec\n", (double)stats.total_written, (double)stats.total_read, (stats.total_written+stats.total_read)/(0.5 + (t-starttime))); @@ -285,6 +285,7 @@ oom: static char *get_local_name(struct file_list *flist,char *name) { STRUCT_STAT st; + int e; extern int orig_umask; if (verbose > 2) @@ -310,7 +311,7 @@ static char *get_local_name(struct file_list *flist,char *name) return name; } - if (flist->count <= 1) + if (flist->count <= 1 && ((e = strlen(name)) <= 1 || name[e-1] != '/')) return name; if (do_mkdir(name,0777 & ~orig_umask) != 0) { @@ -1055,6 +1056,5 @@ int main(int argc,char *argv[]) else exit_cleanup(ret); - exit(ret); - /* NOTREACHED */ + return ret; }