From: Lennart Poettering Date: Thu, 11 Jan 2018 12:09:30 +0000 (+0100) Subject: log: minor modernizations to log_received_signal() X-Git-Tag: v237~107^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a6ab236595b07f98f7e942093bfe4b453c4141cb;p=thirdparty%2Fsystemd.git log: minor modernizations to log_received_signal() --- diff --git a/src/basic/log.c b/src/basic/log.c index b1b44866271..318c55e9017 100644 --- a/src/basic/log.c +++ b/src/basic/log.c @@ -1226,10 +1226,12 @@ static const char *const log_target_table[_LOG_TARGET_MAX] = { DEFINE_STRING_TABLE_LOOKUP(log_target, LogTarget); void log_received_signal(int level, const struct signalfd_siginfo *si) { - if (si->ssi_pid > 0) { + assert(si); + + if (pid_is_valid(si->ssi_pid)) { _cleanup_free_ char *p = NULL; - get_process_comm(si->ssi_pid, &p); + (void) get_process_comm(si->ssi_pid, &p); log_full(level, "Received SIG%s from PID %"PRIu32" (%s).",