From: Mischa POSLAWSKY Date: Mon, 9 Sep 2019 16:51:10 +0000 (+0200) Subject: reset SIGINT after first ignoral X-Git-Tag: v1.05~14 X-Git-Url: http://git.shiar.net/barcat.git/commitdiff_plain/315b1f4fbaf824b7d32ca4168f490adf286324ab reset SIGINT after first ignoral Ensure subsequent signals will break any unexpected hangs. --- diff --git a/barcat b/barcat index 723c7da..c1e1d07 100755 --- a/barcat +++ b/barcat @@ -77,7 +77,10 @@ if (defined $opt{interval}) { } or warn $@, "Expect slowdown with large datasets!\n"; } -$SIG{INT} = 'IGNORE'; # continue after assumed eof +$SIG{INT} = sub { + $SIG{INT} = 'DEFAULT'; # reset for subsequent attempts + 'IGNORE' # continue after assumed eof +}; my $valmatch = qr/$opt{anchor} ( \h* -? [0-9]* \.? [0-9]+ (?: e[+-]?[0-9]+ )? |)/x; while (readline) {