summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2011-02-06 09:39:24 +0000
committerPaul Buetow <paul@buetow.org>2011-02-06 09:39:24 +0000
commite2f5ca5af526f787b07fd23d5acd9205976d9390 (patch)
tree155f578284772562e75d27e3d884c57cb5617770
parent93e3a0775cc9a5b0da83708654bdde124825cc57 (diff)
some bugfixingv1.0
-rw-r--r--perldaemon.pl6
1 files changed, 4 insertions, 2 deletions
diff --git a/perldaemon.pl b/perldaemon.pl
index c2289ab..2873c85 100644
--- a/perldaemon.pl
+++ b/perldaemon.pl
@@ -52,9 +52,11 @@ sub checkpid ($) {
open my $fh, $pidfile or err $config => "Can't read pidfile $pidfile: $!";
my ($pid) = <$fh>;
close $fh;
- chomp $pid;
- err $config => "Process with pid $pid already running" if 0 < int $pid && kill 0, $pid;
+ if (defined $pid) {
+ chomp $pid;
+ err $config => "Process with pid $pid already running" if 0 < int $pid && kill 0, $pid;
+ }
}
sub writepid ($) {