From 0288b27ad870adc437c370c262b7b41990ae0118 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Sat, 16 Apr 2011 20:15:14 +0200 Subject: small fixes atop syslog config patch Signed-off-by: Denys Vlasenko --- sysklogd/Config.src | 2 +- sysklogd/syslogd.c | 12 +++++------- 2 files changed, 6 insertions(+), 8 deletions(-) (limited to 'sysklogd') diff --git a/sysklogd/Config.src b/sysklogd/Config.src index b3e13d7..b7a494e 100644 --- a/sysklogd/Config.src +++ b/sysklogd/Config.src @@ -57,7 +57,7 @@ config FEATURE_SYSLOGD_CFG default y depends on SYSLOGD help - Supports restricted syslogd config. + Supports restricted syslogd config. See docs/syslog.conf.txt config FEATURE_SYSLOGD_READ_BUFFER_SIZE int "Read buffer size in bytes" diff --git a/sysklogd/syslogd.c b/sysklogd/syslogd.c index 0799038..b6f409f 100644 --- a/sysklogd/syslogd.c +++ b/sysklogd/syslogd.c @@ -33,6 +33,8 @@ //usage: "\n -D Drop duplicates") //usage: IF_FEATURE_IPC_SYSLOG( //usage: "\n -C[size(KiB)] Log to shared mem buffer (read it using logread)") +//usage: IF_FEATURE_SYSLOGD_CFG( +//usage: "\n -f FILE Use FILE as config (default is /etc/syslog.conf)") /* NB: -Csize shouldn't have space (because size is optional) */ /* //usage: "\n -m MIN Minutes between MARK lines (default:20, 0=off)" */ //usage: @@ -284,10 +286,8 @@ static void parse_syslogdcfg(const char *file) logRule_t *cur_rule; /* unexpected trailing token? */ - if (tok[2]) { - t = tok[2]; + if (tok[2]) goto cfgerr; - } cur_rule = *pp_rule = xzalloc(sizeof(*cur_rule)); @@ -307,10 +307,8 @@ static void parse_syslogdcfg(const char *file) *next_selector++ = '\0'; t = strchr(cur_selector, '.'); - if (!t) { - t = cur_selector; + if (!t) goto cfgerr; - } *t++ = '\0'; /* separate facility from priority */ negated_prio = 0; @@ -414,7 +412,7 @@ static void parse_syslogdcfg(const char *file) return; cfgerr: - bb_error_msg_and_die("bad line %d: wrong token '%s'", parser->lineno, t); + bb_error_msg_and_die("error in '%s' at line %d", file, parser->lineno); } #endif -- cgit v1.1