Skip to content

Commit dc14b06

Browse files
committed
stale PID file detection -- previous patch cleanup and supress uninit warning
1 parent 83d5f55 commit dc14b06

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

sbin/spectre.pl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,9 @@ BEGIN
114114
die "Spectre is already running.\n";
115115
}
116116
elsif (-e $pidFileName){
117-
# oh, ffs ... die "pidFile $pidFileName already exists\n";
118117
open my $pidFile, '<', $pidFileName or die "$pidFileName: $!";
119118
(my $pid) = readline $pidFile;
120-
chomp $pid;
119+
chomp $pid if defined $pid;
121120
if(defined $pid and $pid =~ m/^(\d+)$/) {
122121
if(kill 0, $1) {
123122
die "$0: already running as PID $1";

0 commit comments

Comments
 (0)