diff options
author | Angus Salkeld <asalkeld@redhat.com> | 2011-03-14 22:40:12 +1100 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2011-03-14 12:05:30 +0000 |
commit | 6f7c1a9f9d76bdf9f112e12e1508531fb41abfb2 (patch) | |
tree | 908246350e6f1a4b48fe96f63b48f8e84a8f3a4f /src | |
parent | eb304e9689ca474834207605ed52c369bcdec6ea (diff) | |
download | libguestfs-6f7c1a9f9d76bdf9f112e12e1508531fb41abfb2.tar.gz libguestfs-6f7c1a9f9d76bdf9f112e12e1508531fb41abfb2.tar.xz libguestfs-6f7c1a9f9d76bdf9f112e12e1508531fb41abfb2.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/launch.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/launch.c b/src/launch.c index e50985de..8de28578 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; |