From 60cd367649aa54e4edc2e906a87f0afba936c87f Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 12 Jul 2019 10:24:00 +0200 Subject: [PATCH] killall: bump log message about unkilled processes to LOG_WARNING By raising this, we can raise the kernel kmsg log level safely, and still see these messages. --- src/core/killall.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/core/killall.c b/src/core/killall.c index 07109196407..81dc1a7bb6e 100644 --- a/src/core/killall.c +++ b/src/core/killall.c @@ -78,27 +78,30 @@ static bool ignore_proc(pid_t pid, bool warn_rootfs) { } static void log_children_no_yet_killed(Set *pids) { - void *p; - Iterator i; _cleanup_free_ char *lst_child = NULL; + Iterator i; + void *p; SET_FOREACH(p, pids, i) { _cleanup_free_ char *s = NULL; - if (get_process_comm(PTR_TO_PID(p), &s) == 0) { - if (!strextend(&lst_child, ", ", s, NULL)) - break; + if (get_process_comm(PTR_TO_PID(p), &s) < 0) + (void) asprintf(&s, PID_FMT, PTR_TO_PID(p)); + + if (!strextend(&lst_child, ", ", s, NULL)) { + log_oom(); + return; } } - if (!isempty(lst_child)) - log_notice("Waiting for process:%s", lst_child + 1); + if (isempty(lst_child)) + return; + + log_warning("Waiting for process: %s", lst_child + 2); } static int wait_for_children(Set *pids, sigset_t *mask, usec_t timeout) { - usec_t until; - usec_t date_log_child; - usec_t n; + usec_t until, date_log_child, n; assert(mask); -- 2.47.3