X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/1ed9018e69a0d224ff59184974d9150d1cb8814d..6767ca617b8cf87feda0298db410473923889abf:/log.c diff --git a/log.c b/log.c index b5bd9667..1e18c9e1 100644 --- a/log.c +++ b/log.c @@ -37,6 +37,7 @@ extern int protocol_version; extern int preserve_times; extern int uid_ndx; extern int gid_ndx; +extern int progress_is_active; extern int stdout_format_has_i; extern int stdout_format_has_o_or_i; extern int logfile_format_has_i; @@ -54,7 +55,7 @@ extern iconv_t ic_chck; extern iconv_t ic_send, ic_recv; #endif extern char curr_dir[]; -extern char *module_dir; +extern char *full_module_path; extern unsigned int module_dirlen; static int log_initialised; @@ -84,7 +85,7 @@ struct { { RERR_SIGNAL , "received SIGINT, SIGTERM, or SIGHUP" }, { RERR_WAITCHILD , "waitpid() failed" }, { RERR_MALLOC , "error allocating core memory buffers" }, - { RERR_PARTIAL , "some files could not be transferred" }, + { RERR_PARTIAL , "some files/attrs were not transferred (see previous errors)" }, { RERR_VANISHED , "some files vanished before they could be transferred" }, { RERR_TIMEOUT , "timeout in data send/receive" }, { RERR_CONTIMEOUT , "timeout waiting for daemon connection" }, @@ -256,13 +257,17 @@ void rwrite(enum logcode code, const char *buf, int len, int is_utf8) if (am_server && msg_fd_out >= 0) { assert(!is_utf8); - /* Pass the message to our sibling. */ + /* Pass the message to our sibling in native charset. */ send_msg((enum msgcode)code, buf, len, 0); return; } if (code == FERROR_SOCKET) /* This gets simplified for a non-sibling. */ code = FERROR; + else if (code == FERROR_UTF8) { + is_utf8 = 1; + code = FERROR; + } if (code == FCLIENT) code = FINFO; @@ -320,6 +325,11 @@ void rwrite(enum logcode code, const char *buf, int len, int is_utf8) exit_cleanup(RERR_MESSAGEIO); } + if (progress_is_active && !am_server) { + fputc('\n', f); + progress_is_active = 0; + } + trailing_CR_or_NL = len && (buf[len-1] == '\n' || buf[len-1] == '\r') ? buf[--len] : 0; @@ -517,7 +527,7 @@ static void log_formatted(enum logcode code, const char *format, const char *op, break; case 'M': n = c = timestring(file->modtime); - while ((c = strchr(p, ' ')) != NULL) + while ((c = strchr(c, ' ')) != NULL) *c = '-'; break; case 'B': @@ -593,7 +603,7 @@ static void log_formatted(enum logcode code, const char *format, const char *op, n = timestring(time(NULL)); break; case 'P': - n = module_dir; + n = full_module_path; break; case 'u': n = auth_user;