summaryrefslogtreecommitdiff
path: root/log.c
diff options
context:
space:
mode:
authorWayne Davison <wayne@opencoder.net>2020-06-04 21:21:05 -0700
committerWayne Davison <wayne@opencoder.net>2020-06-04 21:40:43 -0700
commit916faecb835990164e24ddbfe801acffce3ebf79 (patch)
tree126bcb045a4e91391cf2d63984bd2f64c43cd2f7 /log.c
parent5d7b71b7a7d76d334b104d2e5127a0d29d36d99c (diff)
downloadrsync-916faecb835990164e24ddbfe801acffce3ebf79.tar.gz
Only sender can output non-final stats on error
The receiving side's stats are split between 2 processes until the very end.
Diffstat (limited to 'log.c')
-rw-r--r--log.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/log.c b/log.c
index ded8045b..58ad2736 100644
--- a/log.c
+++ b/log.c
@@ -870,10 +870,14 @@ void log_delete(const char *fname, int mode)
*/
void log_exit(int code, const char *file, int line)
{
- rprintf(FLOG,"sent %s bytes received %s bytes total size %s\n",
- big_num(stats.total_written),
- big_num(stats.total_read),
- big_num(stats.total_size));
+ /* The receiving side's stats are split between 2 procs until the
+ * end of the run, so only the sender can output non-final info. */
+ if (code == 0 || am_sender) {
+ rprintf(FLOG,"sent %s bytes received %s bytes total size %s\n",
+ big_num(stats.total_written),
+ big_num(stats.total_read),
+ big_num(stats.total_size));
+ }
if (code != 0 && am_server != 2) {
const char *name;