X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/4dde3347fb614270f6aa6812598185aa0ccca3ef..84c11e85a4c4a12ecacba24afe9617222e4361e6:/log.c diff --git a/log.c b/log.c index 7be4cec9..4e20c2c8 100644 --- a/log.c +++ b/log.c @@ -265,10 +265,16 @@ void rwrite(enum logcode code, const char *buf, int len, int is_utf8) if (len < 0) exit_cleanup(RERR_MESSAGEIO); - if (msgs2stderr && code != FLOG) - goto output_msg; - - if (send_msgs_to_gen) { + if (msgs2stderr) { + if (!am_daemon) { + if (code == FLOG) + return; + goto output_msg; + } + if (code == FCLIENT) + return; + code = FLOG; + } else if (send_msgs_to_gen) { assert(!is_utf8); /* Pass the message to our sibling in native charset. */ send_msg((enum msgcode)code, buf, len, 0); @@ -330,13 +336,17 @@ output_msg: got_xfer_error = 1; /* FALL THROUGH */ case FERROR: + case FERROR_UTF8: + case FERROR_SOCKET: case FWARNING: f = stderr; break; + case FLOG: case FINFO: case FCLIENT: break; default: + fprintf(stderr, "Unknown logcode in rwrite(): %d\n", (int)code); exit_cleanup(RERR_MESSAGEIO); }