diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2007-09-02 17:13:56 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 15:03:34 -0500 |
commit | c7e8bcfdc980579cd626be9cc4be040df5a7c7c1 (patch) | |
tree | 474c34e3bb0bbb59d451c4ff2de33dc7aaf990d4 | |
parent | 033c2c07a3a080922a35cc674163b1768d0ff227 (diff) | |
download | samba-c7e8bcfdc980579cd626be9cc4be040df5a7c7c1.tar.gz samba-c7e8bcfdc980579cd626be9cc4be040df5a7c7c1.tar.bz2 samba-c7e8bcfdc980579cd626be9cc4be040df5a7c7c1.zip |
r24899: Register signal handler that tears down environment.
(This used to be commit fa89d228dd1988a74eea107ac8c2773cff7b9df1)
-rwxr-xr-x | source4/selftest/selftest.pl | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/source4/selftest/selftest.pl b/source4/selftest/selftest.pl index 9f16db0114..5b5c0146ad 100755 --- a/source4/selftest/selftest.pl +++ b/source4/selftest/selftest.pl @@ -615,6 +615,12 @@ my @exported_envvars = ( "WINBINDD_SOCKET_DIR" ); +$SIG{INT} = $SIG{QUIT} = $SIG{TERM} = sub { + my $signame = shift; + teardown_env($_) foreach(keys %running_envs); + die("Received signal $signame"); +}; + sub setup_env($) { my ($envname) = @_; @@ -633,6 +639,8 @@ sub setup_env($) return undef unless defined($testenv_vars); + $running_envs{$envname} = $testenv_vars; + SocketWrapper::set_default_iface(6); write_clientconf($conffile, $testenv_vars); @@ -644,7 +652,6 @@ sub setup_env($) } } - $running_envs{$envname} = $testenv_vars; return $testenv_vars; } |