]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
test: fix commandtest under autobuild.sh
authorEric Blake <eblake@redhat.com>
Fri, 10 Dec 2010 22:30:56 +0000 (15:30 -0700)
committerEric Blake <eblake@redhat.com>
Mon, 13 Dec 2010 23:04:56 +0000 (16:04 -0700)
* tests/commandtest.c (mymain): Kill off any leaked-in fds.
* autobuild.sh: Don't leak fds.

Signed-off-by: Eric Blake <eblake@redhat.com>
autobuild.sh
tests/commandtest.c

index 8248a5954e6779980eb3626d8155a606e5b31bc7..91e2ab2b8046f83d8d8113ceb2ed52b2e00a7b38 100755 (executable)
@@ -38,7 +38,7 @@ make install
 exec 3>&1
 st=$(
   exec 4>&1 >&3
-  { make check syntax-check 2>&1; echo $? >&4; } | tee "$RESULTS"
+  { make check syntax-check 2>&1 3>&- 4>&-; echo $? >&4; } | tee "$RESULTS"
 )
 exec 3>&-
 test "$st" = 0
index a1bcf688e3558ab5c6323c00fa99e6dca51919ed..333dd4d57c34f141821330e57bb8de5fb7e07259 100644 (file)
@@ -688,6 +688,12 @@ mymain(int argc, char **argv)
     if (chdir("/tmp") < 0)
         return(EXIT_FAILURE);
 
+    /* Kill off any inherited fds that might interfere with our
+     * testing.  */
+    close(3);
+    close(4);
+    close(5);
+
     virInitialize();
 
     const char *const newenv[] = {