From d1f1f74e5f45fa5b94ebb096fa65fa33ecc23d09 Mon Sep 17 00:00:00 2001 From: Angus Salkeld Date: Tue, 15 Mar 2011 22:43:02 +1100 Subject: [PATCH] check the pid is > 0 before calling waitpid() Signed-off-by: Angus Salkeld --- src/guestfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/guestfs.c b/src/guestfs.c index 8b7ab4d..4085506 100644 --- a/src/guestfs.c +++ b/src/guestfs.c @@ -212,7 +212,7 @@ guestfs_close (guestfs_h *g) g->sock = -1; /* Wait for subprocess(es) to exit. */ - waitpid (g->pid, NULL, 0); + if (g->pid > 0) waitpid (g->pid, NULL, 0); if (g->recoverypid > 0) waitpid (g->recoverypid, NULL, 0); /* Remove tmpfiles. */ -- 1.8.3.1