summaryrefslogtreecommitdiff
path: root/log.c
diff options
context:
space:
mode:
authorWayne Davison <wayne@opencoder.net>2020-07-23 10:36:49 -0700
committerWayne Davison <wayne@opencoder.net>2020-07-23 11:23:47 -0700
commit592059c8fd88fbb08f69554bf3176626c7ee7554 (patch)
tree1555c38585e3b476522e08f9d52f4788bf063e1d /log.c
parent37f4a23f609f8be7e60753bfcd1ab3b4cf94714e (diff)
downloadrsync-592059c8fd88fbb08f69554bf3176626c7ee7554.tar.gz
Improve error output for local & remote-shell xfers
Diffstat (limited to 'log.c')
-rw-r--r--log.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/log.c b/log.c
index 0dc26331..e641198c 100644
--- a/log.c
+++ b/log.c
@@ -251,7 +251,7 @@ static void filtered_fwrite(FILE *f, const char *in_buf, int in_len, int use_isp
void rwrite(enum logcode code, const char *buf, int len, int is_utf8)
{
char trailing_CR_or_NL;
- FILE *f = msgs2stderr ? stderr : stdout;
+ FILE *f = msgs2stderr == 1 ? stderr : stdout;
#ifdef ICONV_OPTION
iconv_t ic = is_utf8 && ic_recv != (iconv_t)-1 ? ic_recv : ic_chck;
#else
@@ -263,7 +263,7 @@ void rwrite(enum logcode code, const char *buf, int len, int is_utf8)
if (len < 0)
exit_cleanup(RERR_MESSAGEIO);
- if (msgs2stderr) {
+ if (msgs2stderr == 1) {
/* A normal daemon can get msgs2stderr set if the socket is busted, so we
* change the message destination into an FLOG message in order to try to
* get some info about an abnormal-exit into the log file. An rsh daemon
@@ -327,7 +327,7 @@ void rwrite(enum logcode code, const char *buf, int len, int is_utf8)
exit_cleanup(RERR_MESSAGEIO);
}
- if (am_server && !msgs2stderr) {
+ if (am_server && msgs2stderr != 1 && (msgs2stderr != 2 || f != stderr)) {
enum msgcode msg = (enum msgcode)code;
if (protocol_version < 30) {
if (msg == MSG_ERROR)