X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/059ec3d9952740285fb1ebf47961b8aca2eb1b4a..23c7ff99864ed699b3c6e547c1396a02eb6e4b73:/src/src/transport.c diff --git a/src/src/transport.c b/src/src/transport.c index 855bedd91..8b6841783 100644 --- a/src/src/transport.c +++ b/src/src/transport.c @@ -1,4 +1,4 @@ -/* $Cambridge: exim/src/src/transport.c,v 1.1 2004/10/07 10:39:01 ph10 Exp $ */ +/* $Cambridge: exim/src/src/transport.c,v 1.2 2004/10/14 14:52:45 ph10 Exp $ */ /************************************************* * Exim - an Internet mail transport agent * @@ -1095,29 +1095,34 @@ if (filter_pid > 0 && (rc = child_close(filter_pid, 30)) != 0 && yield) } /* Wait for the writing process to complete. If it ends successfully, -read the results from its pipe. */ +read the results from its pipe, provided we haven't already had a filter +process failure. */ DEBUG(D_transport) debug_printf("waiting for writing process\n"); if (write_pid > 0) { - if ((rc = child_close(write_pid, 30)) == 0) + rc = child_close(write_pid, 30); + if (yield) { - BOOL ok; - read(pfd[pipe_read], (void *)&ok, sizeof(BOOL)); - if (!ok) + if (rc == 0) + { + BOOL ok; + read(pfd[pipe_read], (void *)&ok, sizeof(BOOL)); + if (!ok) + { + read(pfd[pipe_read], (void *)&save_errno, sizeof(int)); + read(pfd[pipe_read], (void *)&(addr->more_errno), sizeof(int)); + yield = FALSE; + } + } + else { - read(pfd[pipe_read], (void *)&save_errno, sizeof(int)); - read(pfd[pipe_read], (void *)&(addr->more_errno), sizeof(int)); yield = FALSE; + save_errno = ERRNO_FILTER_FAIL; + addr->more_errno = rc; + DEBUG(D_transport) debug_printf("writing process returned %d\n", rc); } - } - else if (yield) - { - yield = FALSE; - save_errno = ERRNO_FILTER_FAIL; - addr->more_errno = rc; - DEBUG(D_transport) debug_printf("writing process returned %d\n", rc); - } + } } close(pfd[pipe_read]);