ignore SIGINT so partial input is shown
authorMischa POSLAWSKY <perl@shiar.org>
Thu, 5 Sep 2019 16:07:43 +0000 (18:07 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Thu, 5 Sep 2019 21:56:49 +0000 (23:56 +0200)
Assume interrupt stops pipes and we can continue.  Subsequent signals will
then be reset so calculation can still be killed.

graph

diff --git a/graph b/graph
index 14b717310a819c4272fd1cf4911f5ff6432feea5..d317df5e7f848922e07986cd2fb558ca8973a49c 100755 (executable)
--- a/graph
+++ b/graph
@@ -31,6 +31,8 @@ if (defined $opt{follow}) {
        alarm $opt{follow};
 }
 
+$SIG{INT} = 'IGNORE';  # continue after assumed eof
+
 my (@lines, @values);
 while (readline) {
        chomp;
@@ -48,6 +50,8 @@ while (readline) {
 }
 @lines or exit;
 
+$SIG{INT} = 'DEFAULT';
+
 sub show_lines {
 
 my @order  = sort { $b <=> $a } grep { length } @values;