From: Mike Yuan Date: Sat, 23 Dec 2023 11:08:22 +0000 (+0800) Subject: process-util: ensure pidref_is_alive only return ESRCH if not set X-Git-Tag: v256-rc1~1305^2~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=faf0dd4b29139a1e702d3136dc37bdb033e45927;p=thirdparty%2Fsystemd.git process-util: ensure pidref_is_alive only return ESRCH if not set --- diff --git a/src/basic/process-util.c b/src/basic/process-util.c index 201c5596ae9..cdfe33c1dbd 100644 --- a/src/basic/process-util.c +++ b/src/basic/process-util.c @@ -1112,8 +1112,10 @@ int pidref_is_alive(const PidRef *pidref) { return -ESRCH; result = pid_is_alive(pidref->pid); - if (result < 0) + if (result < 0) { + assert(result != -ESRCH); return result; + } r = pidref_verify(pidref); if (r == -ESRCH)