diff options
author | Wayne Davison <wayne@opencoder.net> | 2020-06-04 21:21:05 -0700 |
---|---|---|
committer | Wayne Davison <wayne@opencoder.net> | 2020-06-04 21:40:43 -0700 |
commit | 916faecb835990164e24ddbfe801acffce3ebf79 (patch) | |
tree | 126bcb045a4e91391cf2d63984bd2f64c43cd2f7 /log.c | |
parent | 5d7b71b7a7d76d334b104d2e5127a0d29d36d99c (diff) | |
download | rsync-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.c | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -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; |