From fc8a6b97051ae24622472b5117f48bdfb2413f57 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 2 Jun 1998 12:46:46 +0000 Subject: [PATCH] added some fflush() calls to make sure the statistics lines are printed when redirecting output to a file. --- main.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/main.c b/main.c index 6fd96a7c..217ddf41 100644 --- a/main.c +++ b/main.c @@ -88,6 +88,9 @@ static void report(int f) printf("total size is %.0f speedup is %.2f\n", (double)stats.total_size, (1.0*stats.total_size)/(stats.total_written+stats.total_read)); + + fflush(stdout); + fflush(stderr); } @@ -412,13 +415,13 @@ int client_run(int f_in, int f_out, int pid, int argc, char *argv[]) } -int start_client(int argc, char *argv[]) +static int start_client(int argc, char *argv[]) { char *p; char *shell_machine = NULL; char *shell_path = NULL; char *shell_user = NULL; - int pid; + int pid, ret; int f_in,f_out; extern int local_server; extern int am_sender; @@ -499,7 +502,12 @@ int start_client(int argc, char *argv[]) setlinebuf(stderr); #endif - return client_run(f_in, f_out, pid, argc, argv); + ret = client_run(f_in, f_out, pid, argc, argv); + + fflush(stdout); + fflush(stderr); + + return ret; } -- 2.34.1