Daemon: correctly set got_hup_signal flag (before we call terminate)

This commit is contained in:
Dietmar Maurer 2015-01-01 10:57:10 +01:00
parent 6105a115c6
commit 93710700b9

View File

@ -299,9 +299,9 @@ my $server_run = sub {
$SIG{HUP} = sub { $SIG{HUP} = sub {
local ($@, $!, $?); # do not overwrite error vars local ($@, $!, $?); # do not overwrite error vars
syslog('info', "received signal HUP"); syslog('info', "received signal HUP");
$self->{got_hup_signal} = 1;
if ($self->{max_workers}) { if ($self->{max_workers}) {
&$terminate_server($self); &$terminate_server($self);
$self->{got_hup_signal} = 1;
} elsif ($self->can('hup')) { } elsif ($self->can('hup')) {
eval { $self->hup() }; eval { $self->hup() };
warn $@ if $@; warn $@ if $@;