From 37077bd3393d04af810a04b122cf96bdf8fde076 Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Sun, 20 Jul 2008 22:20:17 -0700 Subject: [PATCH] Improved the handling of --msgs2stderr a little more. --- cleanup.c | 2 +- log.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cleanup.c b/cleanup.c index 91467825..22e2e35f 100644 --- a/cleanup.c +++ b/cleanup.c @@ -105,7 +105,7 @@ NORETURN void _exit_cleanup(int code, const char *file, int line) code = exit_code; /* If this is the exit at the end of the run, the server side - * should not attempt to output a message (see log.c). */ + * should not attempt to output a message (see log_exit()). */ if (am_server && code == 0) am_server = 2; diff --git a/log.c b/log.c index 5d59419e..58c6bb19 100644 --- a/log.c +++ b/log.c @@ -258,10 +258,8 @@ void rwrite(enum logcode code, const char *buf, int len, int is_utf8) if (len < 0) exit_cleanup(RERR_MESSAGEIO); - if (msgs2stderr && code != FLOG) { - f = stderr; + if (msgs2stderr > 0 && code != FLOG) goto output_msg; - } if (am_server && msg_fd_out >= 0) { assert(!is_utf8); @@ -312,8 +310,10 @@ void rwrite(enum logcode code, const char *buf, int len, int is_utf8) /* TODO: can we send the error to the user somehow? */ return; } + msgs2stderr = -1; } +output_msg: switch (code) { case FERROR_XFER: got_xfer_error = 1; @@ -323,13 +323,13 @@ void rwrite(enum logcode code, const char *buf, int len, int is_utf8) f = stderr; break; case FINFO: - f = am_server ? stderr : stdout; + case FCLIENT: + f = msgs2stderr ? stderr : stdout; break; default: exit_cleanup(RERR_MESSAGEIO); } -output_msg: if (output_needs_newline) { fputc('\n', f); output_needs_newline = 0; -- 2.34.1