git://git.exim.org
/
exim.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Documentation and comment tidies.
[exim.git]
/
src
/
src
/
rda.c
diff --git
a/src/src/rda.c
b/src/src/rda.c
index 06eff227e689d6c253e90cfe6da411f4b5bbc917..1c7fa7dcb78fbab4d5cc86d71c1327f0eb90c5fc 100644
(file)
--- a/
src/src/rda.c
+++ b/
src/src/rda.c
@@
-1,10
+1,10
@@
-/* $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.
13 2006/09/05 14:05
:43 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
*************************************************/
/*************************************************
* Exim - an Internet mail transport agent *
*************************************************/
-/* Copyright (c) University of Cambridge 1995 - 200
5
*/
+/* Copyright (c) University of Cambridge 1995 - 200
6
*/
/* See the file NOTICE for conditions of use and distribution. */
/* This module contains code for extracting addresses from a forwarding list
/* See the file NOTICE for conditions of use and distribution. */
/* This module contains code for extracting addresses from a forwarding list
@@
-352,7
+352,7
@@
uschar *data;
if (rdata->isfile)
{
if (rdata->isfile)
{
- int yield;
+ int yield
= 0
;
data = rda_get_file_contents(rdata, options, error, &yield);
if (data == NULL) return yield;
}
data = rda_get_file_contents(rdata, options, error, &yield);
if (data == NULL) return yield;
}
@@
-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
/* 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);
oldsignal = signal(SIGCHLD, SIG_DFL);
+search_tidyup();
+
if ((pid = fork()) == 0)
{
header_line *waslast = header_last; /* Save last header */
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 */
}
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);
(void)close(fd);
+ search_tidyup();
_exit(0);
}
_exit(0);
}
@@
-764,9
+770,6
@@
if (read(fd, filtertype, sizeof(int)) != sizeof(int) ||
read(fd, &yield, sizeof(int)) != sizeof(int) ||
!rda_read_string(fd, error)) goto DISASTER;
read(fd, &yield, sizeof(int)) != sizeof(int) ||
!rda_read_string(fd, error)) goto DISASTER;
-DEBUG(D_route)
- debug_printf("rda_interpret: subprocess yield=%d error=%s\n", yield, *error);
-
/* Read the contents of any syntax error blocks if we have a pointer */
if (eblockp != NULL)
/* Read the contents of any syntax error blocks if we have a pointer */
if (eblockp != NULL)
@@
-923,6
+926,9
@@
while ((rc = wait(&status)) != pid)
}
}
}
}
+DEBUG(D_route)
+ debug_printf("rda_interpret: subprocess yield=%d error=%s\n", yield, *error);
+
if (had_disaster)
{
*error = string_sprintf("internal problem in %s: failure to transfer "
if (had_disaster)
{
*error = string_sprintf("internal problem in %s: failure to transfer "