From 64c3c5394121ab9f5a93a8c6d2c48511ff720536 Mon Sep 17 00:00:00 2001 From: Matthias Andree Date: Mon, 4 May 2009 21:52:32 +0000 Subject: Major progress ticker bugfix/overhaul. Progress tickers had been used inconsistently for a long time, and documentation was outdated, too. Factor out common code to ease maintenance, use the report_flush() function, and add and use a macro (want_progress()) to determine if progress ticker output is desired. This makes for a much more consistent look on screen and in logfiles and should be much easier to fix later on. TODO: test syslog output. svn path=/branches/BRANCH_6-3/; revision=5290 --- transact.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'transact.c') diff --git a/transact.c b/transact.c index d66d2758..7f658bc8 100644 --- a/transact.c +++ b/transact.c @@ -367,7 +367,7 @@ static void print_ticker(int *tickervar, int bytes) *tickervar += bytes; while (*tickervar >= SIZETICKER) { - if (outlevel > O_SILENT && run.showdots && !run.use_syslog) + if (want_progress()) { fputc('.', stdout); fflush(stdout); @@ -1265,7 +1265,7 @@ int readheaders(int sock, return(PS_IOERR); } - if ((run.poll_interval == 0 || nodetach) && outlevel >= O_VERBOSE && !is_a_file(1) && !run.use_syslog) + if (want_progress()) fputc('#', stdout); /* write error notifications */ @@ -1446,7 +1446,7 @@ int readbody(int sock, struct query *ctl, flag forward, int len) release_sink(ctl); return(PS_IOERR); } - else if (outlevel >= O_VERBOSE && !is_a_file(1) && !run.use_syslog) + else if (want_progress()) { fputc('*', stdout); fflush(stdout); -- cgit v1.2.3