diff options
author | Wayne Davison <wayned@samba.org> | 2008-07-20 20:08:08 -0700 |
---|---|---|
committer | Wayne Davison <wayned@samba.org> | 2008-07-20 20:08:08 -0700 |
commit | eabc85ef5ecd7ed9892ee3d9562468dbb84cbef5 (patch) | |
tree | b99a79b1cce7d19e9ff497bce78b5718688d36ab /log.c | |
parent | 5a18b34de343eca4b5537443e9bb207d91524d7e (diff) | |
download | android_external_rsync-eabc85ef5ecd7ed9892ee3d9562468dbb84cbef5.tar.gz android_external_rsync-eabc85ef5ecd7ed9892ee3d9562468dbb84cbef5.tar.bz2 android_external_rsync-eabc85ef5ecd7ed9892ee3d9562468dbb84cbef5.zip |
Added a debug-helping option, --msgs2stderr, than should help all
messages to be seen in a situation where rsync is dying (as long
as stderr is a viable output method for the remote rsync).
Diffstat (limited to 'log.c')
-rw-r--r-- | log.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -36,6 +36,7 @@ extern int allow_8bit_chars; extern int protocol_version; extern int always_checksum; extern int preserve_times; +extern int msgs2stderr; extern int uid_ndx; extern int gid_ndx; extern int stdout_format_has_i; @@ -257,6 +258,11 @@ 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; + goto output_msg; + } + if (am_server && msg_fd_out >= 0) { assert(!is_utf8); /* Pass the message to our sibling. */ @@ -323,6 +329,7 @@ void rwrite(enum logcode code, const char *buf, int len, int is_utf8) exit_cleanup(RERR_MESSAGEIO); } +output_msg: if (output_needs_newline) { fputc('\n', f); output_needs_newline = 0; |