From 3757913d54c722d60108cfbcb6244bad248db034 Mon Sep 17 00:00:00 2001 From: Robert Spier Date: Sat, 27 Nov 2004 17:54:46 +0000 Subject: [PATCH] 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 --- plugins/queue/qmail-queue | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/plugins/queue/qmail-queue b/plugins/queue/qmail-queue index b7bf475..8c91af4 100644 --- a/plugins/queue/qmail-queue +++ b/plugins/queue/qmail-queue @@ -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 } }