diff options
author | Angus Salkeld <asalkeld@redhat.com> | 2011-03-15 22:43:02 +1100 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2011-03-21 11:29:10 +0000 |
commit | 7ffaf8449773224694898e28b24ad7bc36f23216 (patch) | |
tree | bae026c51a72a60beecc57a19fcdd8fef5fe21b9 | |
parent | 2f88a20d30e2a5723e8d705da00373c7848b9350 (diff) | |
download | libguestfs-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.c | 2 |
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. */ |