From: Michal Privoznik Date: Tue, 9 Sep 2025 11:09:34 +0000 (+0200) Subject: virprocess: Report errno if virProcessAbort() fails X-Git-Tag: v11.8.0-rc1~58 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5a89be06114299f6c31b29bba18f5bdd54dd7161;p=thirdparty%2Flibvirt.git virprocess: Report errno if virProcessAbort() fails The aim of virProcessAbort() is to reap a child process. It does so by waitpid()-ing and possibly sending SIGTERM/SIGKILL to the child process (and waitpid()-ing again). Nevertheless, if everything fails a debug message is printed. But the message mentions only the PID and not errno (set by previous waitpid()) which may be useful. For instance when virProcessAbort() is called over a PID that's not our child: failed to reap child 16325, abandoning it: No child processes Signed-off-by: Michal Privoznik Reviewed-by: Ján Tomko --- diff --git a/src/util/virprocess.c b/src/util/virprocess.c index 3889ba90f9..e8120c1bdc 100644 --- a/src/util/virprocess.c +++ b/src/util/virprocess.c @@ -168,7 +168,8 @@ virProcessAbort(pid_t pid) } } } - VIR_DEBUG("failed to reap child %lld, abandoning it", (long long) pid); + VIR_DEBUG("failed to reap child %lld, abandoning it: %s", + (long long) pid, g_strerror(errno)); cleanup: errno = saved_errno;