tests: Don't leave a libguestfs tmpdir lying around after running test-launch-race.pl.

Calling _exit(2) in the child process has the side effect that
tmp/libguestfsXXXXXX is not cleaned up.  Clean it up by ensuring the
handle is properly closed before _exit.
This commit is contained in:
Richard W.M. Jones
2015-10-06 11:47:08 +01:00
parent 3b56001583
commit bdedb47cf0

View File

@@ -42,7 +42,9 @@ if ($pid == 0) {
my $g = Sys::Guestfs->new ();
$g->add_drive ("/dev/null");
$g->launch ();
_exit (0); # So the tmpdir is not removed.
$g->close ();
# So $tmpdir is not removed by CLEANUP => 1 above.
_exit (0);
}
my $g = Sys::Guestfs->new ();