From: Lennart Poettering Date: Fri, 12 Jul 2019 08:24:00 +0000 (+0200) Subject: killall: bump log message about unkilled processes to LOG_WARNING X-Git-Tag: v243-rc1~133^2~6 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=60cd367649aa54e4edc2e906a87f0afba936c87f;p=thirdparty%2Fsystemd.git 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. --- 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);