]> Sergey Matveev's repositories - public-inbox.git/commitdiff
t/check-www-inbox: trap SIGINT for File::Temp destruction
authorEric Wong <e@80x24.org>
Mon, 21 Jan 2019 06:51:23 +0000 (06:51 +0000)
committerEric Wong <e@80x24.org>
Mon, 21 Jan 2019 06:53:35 +0000 (06:53 +0000)
Otherwise, temporary GDBM files don't get unlinked
when I SIGINT the process.

t/check-www-inbox.perl

index 6232f1647bcc9174a9e0d5a9ee7603c6e5840688..1e88e95229297b2da3de142579aa979acdce41d4 100644 (file)
@@ -14,6 +14,7 @@ use POSIX qw(:sys_wait_h);
 use Time::HiRes qw(gettimeofday tv_interval);
 use WWW::Mechanize;
 use Data::Dumper;
+our $tmp_owner = $$;
 my $nproc = 4;
 my $slow = 0.5;
 my %opts = (
@@ -34,6 +35,7 @@ my $atom_check = eval {
 } if $xmlstarlet;
 
 my %workers;
+$SIG{INT} = sub { exit 130 };
 $SIG{TERM} = sub { exit 0 };
 $SIG{CHLD} = sub {
        while (1) {