From 315b1f4fbaf824b7d32ca4168f490adf286324ab Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Mon, 9 Sep 2019 18:51:10 +0200 Subject: [PATCH] reset SIGINT after first ignoral Ensure subsequent signals will break any unexpected hangs. --- barcat | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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) { -- 2.30.0