From: Mark Wooding Date: Fri, 2 Jul 2021 17:00:53 +0000 (+0100) Subject: disorder-ondemand.in: Guard against `$PID' getting lost halfway through. X-Git-Url: https://git.distorted.org.uk/~mdw/disorder-toys/commitdiff_plain/50bb771248ad33782054b479e40c1077f56a7478 disorder-ondemand.in: Guard against `$PID' getting lost halfway through. --- diff --git a/disorder-ondemand.in b/disorder-ondemand.in index a517e7b..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; };