summaryrefslogtreecommitdiffstats
path: root/src/guestfs.c
diff options
context:
space:
mode:
authorRichard Jones <rjones@trick.home.annexia.org>2009-08-22 10:40:42 +0100
committerRichard Jones <rjones@trick.home.annexia.org>2009-08-22 10:40:42 +0100
commit0abb1ec2b3f0e1f482f93b1c8b3d2ef59bc0321e (patch)
tree9755d57ae929172df4479237eba8036ad99d3105 /src/guestfs.c
parent89c3e552e311744c4a26194b48c07c5bd2d9dd83 (diff)
downloadlibguestfs-0abb1ec2b3f0e1f482f93b1c8b3d2ef59bc0321e.tar.gz
libguestfs-0abb1ec2b3f0e1f482f93b1c8b3d2ef59bc0321e.tar.xz
libguestfs-0abb1ec2b3f0e1f482f93b1c8b3d2ef59bc0321e.zip
Add waitpid along guestfs_close path (RHBZ#518747).
Diffstat (limited to 'src/guestfs.c')
-rw-r--r--src/guestfs.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/guestfs.c b/src/guestfs.c
index 04bd4e88..204125b9 100644
--- a/src/guestfs.c
+++ b/src/guestfs.c
@@ -348,6 +348,10 @@ guestfs_close (guestfs_h *g)
g->fd[1] = -1;
g->sock = -1;
+ /* Wait for subprocess(es) to exit. */
+ waitpid (g->pid, NULL, 0);
+ if (g->recoverypid > 0) waitpid (g->recoverypid, NULL, 0);
+
/* Remove tmpfiles. */
if (g->tmpdir) {
snprintf (filename, sizeof filename, "%s/sock", g->tmpdir);