From: Don Armstrong Date: Mon, 24 Sep 2007 07:47:25 +0000 (+0000) Subject: fix sendmail exit testing X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=6466f891099ed88da2e05afa067b1a40dd2b2145;p=bin.git fix sendmail exit testing --- 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 {