X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Fsrc%2Frda.c;h=1c45f7bb3bb0bcffe81ea5c295c24ac0deba7d78;hb=c8ea159758f4f58b63cebc77067f53264a10f0cf;hp=06eff227e689d6c253e90cfe6da411f4b5bbc917;hpb=f1e894f37fb99398f7447220925a915bd031491a;p=exim.git diff --git a/src/src/rda.c b/src/src/rda.c index 06eff227e..1c45f7bb3 100644 --- a/src/src/rda.c +++ b/src/src/rda.c @@ -1,4 +1,4 @@ -/* $Cambridge: exim/src/src/rda.c,v 1.8 2005/06/27 14:29:43 ph10 Exp $ */ +/* $Cambridge: exim/src/src/rda.c,v 1.10 2005/08/08 13:21:46 ph10 Exp $ */ /************************************************* * Exim - an Internet mail transport agent * @@ -607,9 +607,13 @@ if (pipe(pfd) != 0) /* Ensure that SIGCHLD is set to SIG_DFL before forking, so that the child process can be waited for. We sometimes get here with it set otherwise. Save -the old state for resetting on the wait. */ +the old state for resetting on the wait. Ensure that all cached resources are +freed so that the subprocess starts with a clean slate and doesn't interfere +with the parent process. */ oldsignal = signal(SIGCHLD, SIG_DFL); +search_tidyup(); + if ((pid = fork()) == 0) { header_line *waslast = header_last; /* Save last header */ @@ -740,9 +744,11 @@ if ((pid = fork()) == 0) rda_write_string(fd, NULL); /* Marks end of addresses */ } - /* OK, this process is now done. Must use _exit() and not exit() !! */ + /* OK, this process is now done. Free any cached resources. Must use _exit() + and not exit() !! */ (void)close(fd); + search_tidyup(); _exit(0); } @@ -764,6 +770,11 @@ if (read(fd, filtertype, sizeof(int)) != sizeof(int) || read(fd, &yield, sizeof(int)) != sizeof(int) || !rda_read_string(fd, error)) goto DISASTER; +/* In the test harness, give the subprocess time to finish off and write +any debugging output. */ + +if (running_in_test_harness) millisleep(250); + DEBUG(D_route) debug_printf("rda_interpret: subprocess yield=%d error=%s\n", yield, *error);