Simplify the msgs2stderr default logic.
authorWayne Davison <wayne@opencoder.net>
Thu, 23 Jul 2020 19:14:07 +0000 (12:14 -0700)
committerWayne Davison <wayne@opencoder.net>
Thu, 23 Jul 2020 19:15:50 +0000 (12:15 -0700)
options.c

index ecd1a1f7050c099c833e14467373f12124319105..2ef2dbf219a2af88753db8b896dc2d12dafaa42d 100644 (file)
--- a/options.c
+++ b/options.c
@@ -91,7 +91,7 @@ int relative_paths = -1;
 int implied_dirs = 1;
 int missing_args = 0; /* 0 = FERROR_XFER, 1 = ignore, 2 = delete */
 int numeric_ids = 0;
-int msgs2stderr = -1;
+int msgs2stderr = 2; /* Default: send errors to stderr for local & remote-shell transfers */
 int allow_8bit_chars = 0;
 int force_delete = 0;
 int io_timeout = 0;
@@ -2187,9 +2187,7 @@ int parse_arguments(int *argc_p, const char ***argv_p)
                setvbuf(stdout, (char *)NULL, mode, 0);
        }
 
-       if (msgs2stderr < 0)
-               msgs2stderr = am_daemon > 0 ? 0 : 2;
-       if (msgs2stderr == 1) {
+       if (msgs2stderr == 1) { /* Are all messages going to stderr? */
                /* Make stderr line buffered for better sharing of the stream. */
                fflush(stderr); /* Just in case... */
                setvbuf(stderr, (char *)NULL, _IOLBF, 0);