summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2012-08-15 14:07:35 +0100
committerRichard W.M. Jones <rjones@redhat.com>2012-08-15 17:49:48 +0100
commitfad0f53dc8a21b61dc5ff011d836f5fd5fdab0c3 (patch)
treee79a47494d866143fd73dff72c23b631ed010b80 /src
parent7dd2389359d190e81696f1b2e91e719bdc1822f2 (diff)
downloadlibguestfs-fad0f53dc8a21b61dc5ff011d836f5fd5fdab0c3.tar.gz
libguestfs-fad0f53dc8a21b61dc5ff011d836f5fd5fdab0c3.tar.xz
libguestfs-fad0f53dc8a21b61dc5ff011d836f5fd5fdab0c3.zip
New internal APIs: internal-test-set-output, internal-test-close-output.
These internal (testing) APIs allow the bindtests output to be sent to some other place than stdout. This is necessary for Erlang, since stdout is used to communicate with the Erlang interpreter.
Diffstat (limited to 'src')
-rw-r--r--src/guestfs-internal.h3
-rw-r--r--src/guestfs.c4
2 files changed, 7 insertions, 0 deletions
diff --git a/src/guestfs-internal.h b/src/guestfs-internal.h
index 37526063..dc6f01a2 100644
--- a/src/guestfs-internal.h
+++ b/src/guestfs-internal.h
@@ -245,6 +245,9 @@ struct guestfs_h
struct timeval launch_t; /* The time that we called guestfs_launch. */
+ /* Used by bindtests. */
+ FILE *test_fp;
+
/*** Protocol. ***/
int fd[2]; /* Stdin/stdout of qemu. */
int sock; /* Daemon communications socket. */
diff --git a/src/guestfs.c b/src/guestfs.c
index b5874a88..c5062575 100644
--- a/src/guestfs.c
+++ b/src/guestfs.c
@@ -270,6 +270,10 @@ guestfs_close (guestfs_h *g)
/* Remove whole temporary directory. */
guestfs___remove_tmpdir (g->tmpdir);
+ /* Test output file used by bindtests. */
+ if (g->test_fp != NULL)
+ fclose (g->test_fp);
+
/* Mark the handle as dead and then free up all memory. */
g->state = NO_HANDLE;