summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAngus Salkeld <asalkeld@redhat.com>2011-03-15 22:43:02 +1100
committerRichard W.M. Jones <rjones@redhat.com>2011-03-21 11:29:10 +0000
commit7ffaf8449773224694898e28b24ad7bc36f23216 (patch)
treebae026c51a72a60beecc57a19fcdd8fef5fe21b9
parent2f88a20d30e2a5723e8d705da00373c7848b9350 (diff)
downloadlibguestfs-7ffaf8449773224694898e28b24ad7bc36f23216.tar.gz
libguestfs-7ffaf8449773224694898e28b24ad7bc36f23216.tar.xz
libguestfs-7ffaf8449773224694898e28b24ad7bc36f23216.zip
check the pid is > 0 before calling waitpid()
Signed-off-by: Angus Salkeld <asalkeld@redhat.com> (cherry picked from commit d1f1f74e5f45fa5b94ebb096fa65fa33ecc23d09)
-rw-r--r--src/guestfs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/guestfs.c b/src/guestfs.c
index 488b6586..bd1d0f35 100644
--- a/src/guestfs.c
+++ b/src/guestfs.c
@@ -214,7 +214,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. */