diff options
author | Kozlov Dmitry <dima@server> | 2010-09-27 13:27:12 +0400 |
---|---|---|
committer | Kozlov Dmitry <dima@server> | 2010-09-27 13:27:12 +0400 |
commit | 59d9616d73973c529b08578f3596acaa081cd8bf (patch) | |
tree | 947fd1ab82c41beb57bba81e4e51ee5a4951bc6f /accel-pptpd/log.c | |
parent | f122327288ae4429bb88a0fefdcef0bf80f54023 (diff) | |
download | accel-ppp-59d9616d73973c529b08578f3596acaa081cd8bf.tar.gz accel-ppp-59d9616d73973c529b08578f3596acaa081cd8bf.zip |
bug fixes
Diffstat (limited to 'accel-pptpd/log.c')
-rw-r--r-- | accel-pptpd/log.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/accel-pptpd/log.c b/accel-pptpd/log.c index fee1b548..e942686b 100644 --- a/accel-pptpd/log.c +++ b/accel-pptpd/log.c @@ -5,6 +5,7 @@ #include <errno.h> #include <string.h> #include <stdint.h> +#include <signal.h> #include <sys/time.h> #include "triton/mempool.h" @@ -402,14 +403,27 @@ void __export log_switch(struct triton_context_t *ctx, void *arg) cur_ppp = (struct ppp_t *)arg; } + void __export log_register_target(struct log_target_t *t) { list_add_tail(&t->entry, &targets); } +static void sighup(int n) +{ + struct log_target_t *t; + + list_for_each_entry(t, &targets, entry) + if (t->reopen) + t->reopen(); +} + static void __init log_init(void) { char *opt; + struct sigaction sa = { + .sa_handler = sighup, + }; opt = conf_get_opt("log", "log-emerg"); if (opt) { @@ -428,4 +442,7 @@ static void __init log_init(void) msg_pool = mempool_create(sizeof(struct log_msg_t)); _msg_pool = mempool_create(sizeof(struct _log_msg_t)); chunk_pool = mempool_create(sizeof(struct log_chunk_t) + LOG_CHUNK_SIZE + 1); + + sigaction(SIGHUP, &sa, NULL); } + |