From faf0dd4b29139a1e702d3136dc37bdb033e45927 Mon Sep 17 00:00:00 2001 From: Mike Yuan Date: Sat, 23 Dec 2023 19:08:22 +0800 Subject: [PATCH] process-util: ensure pidref_is_alive only return ESRCH if not set --- src/basic/process-util.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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)