Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Silence warnings when a pidfile is not set. Don't try to write a pidfile

if it has not been enabled in the settings.
  • Loading branch information...
commit d80bb7d446b3fe6a7592c21b6c6b0e10ebf736de 1 parent ec7487f
@lwsitu lwsitu authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  lib/Bot/Pastebot/Administrivia.pm
View
3  lib/Bot/Pastebot/Administrivia.pm
@@ -41,7 +41,7 @@ sub get_pid {
my $name = _get_name();
my %conf = get_items_by_name($name);
my $pidfile = $conf{pidfile};
- return unless -e $pidfile;
+ return unless $pidfile && -e $pidfile;
my $pid = do {
local $/;
open my $fh, '<', $pidfile or die "open($pidfile): $!";
@@ -56,6 +56,7 @@ sub write_pidfile {
my $name = _get_name();
my %conf = get_items_by_name($name);
my $pidfile = $conf{pidfile};
+ return unless $pidfile;
open my $fh, '>', $pidfile or die "open($pidfile): $!";
print $fh $$;
close $fh;
Please sign in to comment.
Something went wrong with that request. Please try again.