Clean up exit codes.

git-svn-id: https://svn.perl.org/qpsmtpd/trunk@942 958fd67b-6ff1-0310-b445-bb7760255be9
This commit is contained in:
Radu Greab 2008-09-04 11:43:08 +00:00 committed by Ask Bjørn Hansen
parent 409372ce58
commit ab6dd83b6c
2 changed files with 6 additions and 4 deletions

View File

@ -1,3 +1,5 @@
prefork: exit codes cleanup (based on patch by Diego d'Ambra)
prefork: detect and reset locked shared memory (based on patch by prefork: detect and reset locked shared memory (based on patch by
Diego d'Ambra) Diego d'Ambra)

View File

@ -401,14 +401,14 @@ sub new_child {
my $sigset = POSIX::SigSet->new(); my $sigset = POSIX::SigSet->new();
my $blockset = POSIX::SigSet->new(SIGCHLD); my $blockset = POSIX::SigSet->new(SIGCHLD);
sigprocmask(SIG_UNBLOCK, $blockset, $sigset) sigprocmask(SIG_UNBLOCK, $blockset, $sigset)
or die "Could not unblock SIGHUP signal: $!\n"; or die "Could not unblock SIGCHLD signal: $!\n";
$SIG{CHLD} = $SIG{INT} = $SIG{TERM} = $SIG{ALRM} = 'DEFAULT'; $SIG{CHLD} = $SIG{INT} = $SIG{TERM} = $SIG{ALRM} = 'DEFAULT';
# child should exit if it receives HUP signal (note: blocked while child # child should exit if it receives HUP signal (note: blocked while child
# is busy, but restored once done) # is busy, but restored once done)
$SIG{HUP} = sub { $SIG{HUP} = sub {
info("signal HUP received, going to exit"); info("signal HUP received, going to exit");
exit 1; exit;
}; };
# continue to accept connections until "old age" is reached # continue to accept connections until "old age" is reached
@ -672,8 +672,8 @@ sub qpsmtpd_session {
print $client "421 Connection Timed Out\n"; print $client "421 Connection Timed Out\n";
info("Connection Timed Out"); info("Connection Timed Out");
# kill the child # child terminates
exit 1; exit;
}; };
# set enviroment variables # set enviroment variables