]> git.ipfire.org Git - thirdparty/libvirt.git/commit
tests: avoid crash when run under gcov
authorEric Blake <eblake@redhat.com>
Wed, 11 May 2011 15:51:30 +0000 (09:51 -0600)
committerEric Blake <eblake@redhat.com>
Wed, 11 May 2011 15:58:35 +0000 (09:58 -0600)
commit70ea7decbed7678a3e9a4114af1c1b412ba8071d
treeccb1ded91c8ca2ddade097a28e3bd37fa1272879
parentba13a37cfff2711f8b3771f202a5726a2c07b4f2
tests: avoid crash when run under gcov

Running ./autobuild.sh failed when gcov is installed, because
commandtest ended up crashing during gcov's getenv() call after
exit() had already started.  I traced this nasty bug back to
a scoping issue present since the test introduction.

* tests/commandtest.c (mymain): Move newenv...
(newenv): ...to a scope that is still useful during exit().
tests/commandtest.c