X-Git-Url: https://git.distorted.org.uk/~mdw/disorder-toys/blobdiff_plain/8537d8f89b9f35271347580db8ae4ef3fd855d38..HEAD:/disorder-ondemand.in diff --git a/disorder-ondemand.in b/disorder-ondemand.in index d9429bb..98e39c2 100755 --- a/disorder-ondemand.in +++ b/disorder-ondemand.in @@ -49,7 +49,7 @@ $SIG{CHLD} = sub { }; $SIG{TERM} = $SIG{INT} = sub { - kill "TERM", $PID if defined $PID; + eval { my $pid = $PID; kill "TERM", $pid if defined $pid; }; exit 0; }; @@ -130,7 +130,7 @@ sub watch_status () { } @lines = split /\n/, $buffer, -1; - $buffer = pop @lines; + $buffer = pop(@lines) // ""; } for my $line (@lines) {