Remove extraneous filehandling twiddling from qmail-queue that could cause weirdness if the exec failed.

git-svn-id: https://svn.perl.org/qpsmtpd/trunk@351 958fd67b-6ff1-0310-b445-bb7760255be9
This commit is contained in:
Robert Spier 2004-11-27 17:54:46 +00:00
parent 3341a5b4ab
commit 3757913d54

View File

@ -99,16 +99,11 @@ sub queue_handler {
POSIX::dup2(fileno(MESSAGE_READER), 0) or die "Unable to dup MESSAGE_READER: $!";
POSIX::dup2(fileno(ENVELOPE_READER), 1) or die "Unable to dup ENVELOPE_READER: $!";
$self->log(LOGNOTICE, "Queuing to $queue_exec");
my $ppid = getppid();
$self->log(LOGNOTICE, "(for $ppid ) Queuing to $queue_exec");
my $rc = exec $queue_exec;
# restore the original STDIN and STDOUT
open(STDIN, "<&SAVE_STDIN");
open(STDOUT, ">&SAVE_STDOUT");
# NB: The "if not $rc" is redundant since exec() won't return if it
# succeeds.
exit 6 if not $rc;
exit 6; # we'll only get here if the exec fails
}
}