[Libguestfs] [PATCH] Add waitpid along guestfs_close path (RHBZ#518747)
Richard W.M. Jones
rjones at redhat.com
Sat Aug 22 09:43:27 UTC 2009
Not quite sure what happened to the waitpid()s which were along that
path, but at some point they seem to have got deleted. This is a fix
for:
https://bugzilla.redhat.com/show_bug.cgi?id=518747
I haven't been able to run the tests yet however, because currently
Rawhide is broken (ntfsprogs has missing dependencies).
Rich.
--
Richard Jones, Emerging Technologies, Red Hat http://et.redhat.com/~rjones
libguestfs lets you edit virtual machines. Supports shell scripting,
bindings from many languages. http://et.redhat.com/~rjones/libguestfs/
See what it can do: http://et.redhat.com/~rjones/libguestfs/recipes.html
-------------- next part --------------
>From 0abb1ec2b3f0e1f482f93b1c8b3d2ef59bc0321e Mon Sep 17 00:00:00 2001
From: Richard Jones <rjones at trick.home.annexia.org>
Date: Sat, 22 Aug 2009 10:40:42 +0100
Subject: [PATCH] Add waitpid along guestfs_close path (RHBZ#518747).
---
src/guestfs.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/src/guestfs.c b/src/guestfs.c
index 04bd4e8..204125b 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);
--
1.6.2.5
More information about the Libguestfs
mailing list