]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
show-status: suffix output ith CRNL rather than just NL
authorLennart Poettering <lennart@poettering.net>
Fri, 24 Nov 2023 15:41:47 +0000 (16:41 +0100)
committerLennart Poettering <lennart@poettering.net>
Wed, 6 Dec 2023 21:11:54 +0000 (22:11 +0100)
This is similar to #30183 but focusses on the status output rather than
the log output.

Since the status output always goes to a TTY we don't have to
conditionalize things on isatty().

Fixes: #30184
src/core/show-status.c

index 1d47c0af4d2db4b9bfc5ffc7a86cab7488c750e6..606237ee0eaa45f51f6a0d6a4bd4f12d05b76a13 100644 (file)
@@ -94,7 +94,7 @@ int status_vprintf(const char *status, ShowStatusFlags flags, const char *format
         }
 
         iovec[n++] = IOVEC_MAKE_STRING(s);
-        iovec[n++] = IOVEC_MAKE_STRING("\n");
+        iovec[n++] = IOVEC_MAKE_STRING("\r\n"); /* use CRNL instead of just NL, to be robust towards TTYs in raw mode */
 
         if (prev_ephemeral && !FLAGS_SET(flags, SHOW_STATUS_EPHEMERAL))
                 iovec[n++] = IOVEC_MAKE_STRING(ANSI_ERASE_TO_END_OF_LINE);