From 22a6c3c35b7dfd1646228faadc2bd748a92ff939 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Wed, 5 Dec 2018 21:34:24 +0100 Subject: [PATCH] coredump: fix message when we fail to save a journald coredump If creation of the message failed, we'd write a bogus entry: systemd-coredump[1400]: Cannot store coredump of 416 (systemd-journal): No space left on device systemd-coredump[1400]: MESSAGE=Process 416 (systemd-journal) of user 0 dumped core. systemd-coredump[1400]: Coredump diverted to (cherry picked from commit f0136e09221364f931c3a3b715da4e4d3ee9f2ac) (cherry picked from commit 3f11736ae9f336ddbc34ad395c9fe5c99139af39) Gbp-Pq: Name coredump-fix-message-when-we-fail-to-save-a-journald-core.patch --- src/coredump/coredump.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/coredump/coredump.c b/src/coredump/coredump.c index db2cf64d..516f63d3 100644 --- a/src/coredump/coredump.c +++ b/src/coredump/coredump.c @@ -794,8 +794,8 @@ log: core_message = strjoin("MESSAGE=Process ", context[CONTEXT_PID], " (", context[CONTEXT_COMM], ") of user ", context[CONTEXT_UID], " dumped core.", - journald_crash ? "\nCoredump diverted to " : NULL, - journald_crash ? filename : NULL); + journald_crash && filename ? "\nCoredump diverted to " : NULL, + journald_crash && filename ? filename : NULL); if (!core_message) return log_oom(); -- 2.30.2