git.shiar.nl
/
barcat.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e31503d
)
reset SIGINT after first ignoral
author
Mischa POSLAWSKY
<perl@shiar.org>
Mon, 9 Sep 2019 16:51:10 +0000
(18:51 +0200)
committer
Mischa POSLAWSKY
<perl@shiar.org>
Mon, 9 Sep 2019 22:37:53 +0000
(
00:37
+0200)
Ensure subsequent signals will break any unexpected hangs.
barcat
patch
|
blob
|
history
diff --git
a/barcat
b/barcat
index 723c7da3a3f6e4d0045b41413ef9e06f1d2cc87d..c1e1d079ce40d75a5cf04a5a68fd499d222a2cd7 100755
(executable)
--- 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) {