From: Michal Privoznik <mpriv...@redhat.com>

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 <mpriv...@redhat.com>
---
 src/util/virprocess.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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;
-- 
2.49.1

Reply via email to