From 6466f891099ed88da2e05afa067b1a40dd2b2145 Mon Sep 17 00:00:00 2001 From: Don Armstrong Date: Mon, 24 Sep 2007 07:47:25 +0000 Subject: [PATCH] fix sendmail exit testing --- delay_mail | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/delay_mail b/delay_mail index 9b5ef44..d9443e2 100755 --- a/delay_mail +++ b/delay_mail @@ -235,12 +235,9 @@ elsif ($options{process}) { open($sendmail_fh,'|-','/usr/sbin/sendmail',$q_e->{mailto}) or die "Unable to open sendmail to send message"; print {$sendmail_fh} $q_e->{email}; - close($sendmail_fh); - waitpid(-1,0); - if ($?) { - print STDERR "Sendmail failed with $?\n"; - exit $?; - } + close($sendmail_fh) or + print STDERR "Sendmail failed with $?\n" and + exit $?; unlink("$options{queue}/$options{process}"); } else { -- 2.39.5