]> git.donarmstrong.com Git - bin.git/commitdiff
fix sendmail exit testing
authorDon Armstrong <don@donarmstrong.com>
Mon, 24 Sep 2007 07:47:25 +0000 (07:47 +0000)
committerDon Armstrong <don@donarmstrong.com>
Mon, 24 Sep 2007 07:47:25 +0000 (07:47 +0000)
delay_mail

index 9b5ef44c74af5815812f9a283ef8fe915bc91eb8..d9443e2d6a0b18ff74660248af9b9bf26e8f7337 100755 (executable)
@@ -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 {