1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-25 01:34:28 +03:00

log: merge conditions to reduce indentation

This commit is contained in:
Yu Watanabe 2020-12-09 01:21:31 +09:00
parent 9e36b885b8
commit 5941112e7e

View File

@ -387,12 +387,11 @@ static int write_to_console(
iovec[n++] = IOVEC_MAKE_STRING(prefix);
}
if (show_time) {
if (format_timestamp(header_time, sizeof(header_time), now(CLOCK_REALTIME))) {
if (show_time &&
format_timestamp(header_time, sizeof(header_time), now(CLOCK_REALTIME))) {
iovec[n++] = IOVEC_MAKE_STRING(header_time);
iovec[n++] = IOVEC_MAKE_STRING(" ");
}
}
if (show_tid) {
xsprintf(tid_string, "(" PID_FMT ") ", gettid());