use vars qw($VERSION @ISA @EXPORT_OK %EXPORT_TAGS $Q $SIG_CODEREF);
BEGIN {
- $VERSION = '0.22';
+ $VERSION = '0.24';
@ISA = qw(Exporter);
@EXPORT_OK = qw(pm_manage pm_die pm_wait
pm_write_pid_file pm_remove_pid_file
my ($this) = self_or_default(@_);
# wait for the next server to die.
- return if (my $pid = wait() < 0);
+ return if ((my $pid = wait()) < 0);
# notify when one of our servers have died.
delete $this->{PIDS}->{$pid} and
sub pm_write_pid_file {
my ($this,$fname) = self_or_default(@_);
$fname ||= $this->pid_fname() or return;
- if (!open PIDFILE, ">$fname") {
+ my $PIDFILE
+ if (!open $PIDFILE, ">$fname") {
$this->pm_warn("open: $fname: $!");
return;
}
- print PIDFILE "$$\n";
- close PIDFILE;
+ print $PIDFILE "$$\n" or die "Could not print PID: $!";
+ close $PIDFILE or die "Could not close PID file";
}
=head2 pm_remove_pid_file