Skip to content

Commit

Permalink
wsd: do not complain if process is reaped already
Browse files Browse the repository at this point in the history
When a process is already reaped, waitpid(3) will
fail. Instead of blindly warning, we first check
if the process or its zombie still exists.
If neither is found, there is nothing to do,
and therefore nothing to warn about.

Change-Id: I4d2d35a58eb3cfe6b70b0d2593e62f4ee1015581
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
  • Loading branch information
Ashod committed Dec 18, 2024
1 parent fef139c commit 35a155e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion common/SigUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ void requestShutdown()
return std::make_pair(ret, WTERMSIG(status));
}
}
else if (pid > 0)
else if (pid > 0 && ::kill(pid, 0) == 0) // Don't complain if the process is reaped already.
{
// Log errno if we had a child pid we expected to reap.
LOG_WRN("Failed to reap child process " << pid << " (" << Util::symbolicErrno(errno)
Expand Down

0 comments on commit 35a155e

Please sign in to comment.