From d055a18ee1d2298b72b4e4273401426b2226fd39 Mon Sep 17 00:00:00 2001 From: laforge Date: Sat, 12 Feb 2005 21:22:44 +0000 Subject: use c99 initializers, move logefile parsing to correct function --- ulogd/extensions/ulogd_LOGEMU.c | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) (limited to 'ulogd/extensions') diff --git a/ulogd/extensions/ulogd_LOGEMU.c b/ulogd/extensions/ulogd_LOGEMU.c index 049bcd4..383f5a6 100644 --- a/ulogd/extensions/ulogd_LOGEMU.c +++ b/ulogd/extensions/ulogd_LOGEMU.c @@ -1,4 +1,4 @@ -/* ulogd_LOGEMU.c, Version $Revision: 1.15 $ +/* ulogd_LOGEMU.c, Version $Revision$ * * ulogd output target for syslog logging emulation * @@ -46,14 +46,20 @@ ((unsigned char *)&addr)[2], \ ((unsigned char *)&addr)[3] -static config_entry_t syslogf_ce = { NULL, "file", CONFIG_TYPE_STRING, - CONFIG_OPT_NONE, 0, - { string: ULOGD_LOGEMU_DEFAULT } }; +static config_entry_t syslogf_ce = { + .key = "file", + .type = CONFIG_TYPE_STRING, + .options = CONFIG_OPT_NONE, + .u.string = ULOGD_LOGEMU_DEFAULT +}; -static config_entry_t syslsync_ce = { &syslogf_ce, "sync", - CONFIG_TYPE_INT, CONFIG_OPT_NONE, 0, - { value: ULOGD_LOGEMU_SYNC_DEFAULT } - }; +static config_entry_t syslsync_ce = { + .next = &syslogf_ce, + .key = "sync", + .type = CONFIG_TYPE_INT, + .options = CONFIG_OPT_NONE, + .u.value = ULOGD_LOGEMU_SYNC_DEFAULT, +}; static FILE *of = NULL; @@ -91,6 +97,9 @@ static void signal_handler_logemu(int signal) static int init_logemu(void) { + /* FIXME: error handling */ + config_parse_file("LOGEMU", &syslsync_ce); + #ifdef DEBUG_LOGEMU of = stdout; #else @@ -123,8 +132,5 @@ static ulog_output_t logemu_op = { void _init(void) { - /* FIXME: error handling */ - config_parse_file("LOGEMU", &syslsync_ce); - register_output(&logemu_op); } -- cgit v1.2.3