From: Wayne Davison Date: Mon, 18 May 2020 03:21:45 +0000 (-0700) Subject: Need to flush early errors before we exit. X-Git-Tag: v3.2.0pre1~143 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e448d31d6386ddb7686a83cbc85457e5f78cdb34;p=thirdparty%2Frsync.git Need to flush early errors before we exit. --- diff --git a/NEWS b/NEWS index d2043bae..23b7f034 100644 --- a/NEWS +++ b/NEWS @@ -24,6 +24,9 @@ Changes since 3.1.3: - Fixed an issue with --remove-source-files not removing a source symlink when combined with --copy-links. + - Fixed a bug where the daemon would fail to write early fatal error + messages to the client, such as refused or unknown command-line options. + - Fixed the block-size validation logic when dealing with older protocols. - Some rrsync fixes and enhancements to handle the latest options. diff --git a/clientserver.c b/clientserver.c index 3970f507..e5a631a3 100644 --- a/clientserver.c +++ b/clientserver.c @@ -965,6 +965,7 @@ static int rsync_module(int f_in, int f_out, int i, const char *addr, const char } if (*err_msg) rprintf(FERROR, "%s\n", err_msg); + io_flush(FULL_FLUSH); } else option_error(); msleep(400); diff --git a/main.c b/main.c index 3b37796d..ca96270a 100644 --- a/main.c +++ b/main.c @@ -1700,8 +1700,6 @@ int main(int argc,char *argv[]) #endif if (!parse_arguments(&argc, (const char ***) &argv)) { - /* FIXME: We ought to call the same error-handling - * code here, rather than relying on getopt. */ option_error(); exit_cleanup(RERR_SYNTAX); } diff --git a/options.c b/options.c index 66854ca0..a6693006 100644 --- a/options.c +++ b/options.c @@ -1138,6 +1138,7 @@ void option_error(void) } rprintf(FERROR, RSYNC_NAME ": %s", err_buf); + io_flush(FULL_FLUSH); msleep(20); }