From 6f7c1a9f9d76bdf9f112e12e1508531fb41abfb2 Mon Sep 17 00:00:00 2001 From: Angus Salkeld Date: Mon, 14 Mar 2011 22:40:12 +1100 Subject: [PATCH] check the pid is > 0 before calling waitpid() Signed-off-by: Angus Salkeld --- src/launch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/launch.c b/src/launch.c index e50985d..8de2857 100644 --- a/src/launch.c +++ b/src/launch.c @@ -769,7 +769,7 @@ launch_appliance (guestfs_h *g) } if (g->pid > 0) kill (g->pid, 9); if (g->recoverypid > 0) kill (g->recoverypid, 9); - waitpid (g->pid, NULL, 0); + if (g->pid > 0) waitpid (g->pid, NULL, 0); if (g->recoverypid > 0) waitpid (g->recoverypid, NULL, 0); g->fd[0] = -1; g->fd[1] = -1; -- 1.8.3.1