diff options
author | Robert James Kaes <rjkaes@users.sourceforge.net> | 2002-10-03 20:33:09 +0000 |
---|---|---|
committer | Robert James Kaes <rjkaes@users.sourceforge.net> | 2002-10-03 20:33:09 +0000 |
commit | ac881909bfff6c86bf758ba66ad10af4cc291a40 (patch) | |
tree | bfc677316c1b36083347ea0e63f8b9b356a4978c /src | |
parent | ef0656db3e310a332ff31b4f47f74b3c9b4928b0 (diff) |
(child_main): Check to make sure memory could be allocated to handle
the child request.
(child_main_loop): Added a call to truncate_log_file() when the log
file is to be rotated.
Diffstat (limited to 'src')
-rw-r--r-- | src/child.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/child.c b/src/child.c index 67b9777..9718ddb 100644 --- a/src/child.c +++ b/src/child.c @@ -1,4 +1,4 @@ -/* $Id: child.c,v 1.5 2002-06-27 16:29:21 rjkaes Exp $ +/* $Id: child.c,v 1.6 2002-10-03 20:33:09 rjkaes Exp $ * * Handles the creation/destruction of the various children required for * processing incoming connections. @@ -164,8 +164,11 @@ child_main(struct child_s* ptr) socklen_t clilen; cliaddr = safemalloc(addrlen); - if (!cliaddr) + if (!cliaddr) { + log_message(LOG_CRIT, + "Could not allocate memory for child address."); exit(0); + } ptr->connects = 0; @@ -382,6 +385,8 @@ child_main_loop(void) /* Handle log rotation if it was requested */ if (received_sighup) { + truncate_log_file(); + #ifdef FILTER_ENABLE if (config.filter) { filter_destroy(); |