summaryrefslogtreecommitdiffstats
path: root/src
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-15 12:16:50 +0000
commitd1f1f74e5f45fa5b94ebb096fa65fa33ecc23d09 (patch)
treeb65945c4c33473bb462ed933136b4ab39f58c73d /src
parent6f7c1a9f9d76bdf9f112e12e1508531fb41abfb2 (diff)
downloadlibguestfs-d1f1f74e5f45fa5b94ebb096fa65fa33ecc23d09.tar.gz
libguestfs-d1f1f74e5f45fa5b94ebb096fa65fa33ecc23d09.tar.xz
libguestfs-d1f1f74e5f45fa5b94ebb096fa65fa33ecc23d09.zip
check the pid is > 0 before calling waitpid()
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Diffstat (limited to 'src')
-rw-r--r--src/guestfs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/guestfs.c b/src/guestfs.c
index 8b7ab4d7..40855066 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. */