diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2011-04-16 20:15:14 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2011-04-16 20:15:14 +0200 |
commit | 0288b27ad870adc437c370c262b7b41990ae0118 (patch) | |
tree | faa0c0dd84073b77b233d933c8cd39aa1d60ccc3 /sysklogd | |
parent | 89b3cbaa97d715ac27e9558ea73a1221925f589b (diff) | |
download | busybox-0288b27ad870adc437c370c262b7b41990ae0118.tar.gz |
small fixes atop syslog config patch
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'sysklogd')
-rw-r--r-- | sysklogd/Config.src | 2 | ||||
-rw-r--r-- | sysklogd/syslogd.c | 12 |
2 files changed, 6 insertions, 8 deletions
diff --git a/sysklogd/Config.src b/sysklogd/Config.src index b3e13d7c0..b7a494eff 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 0799038e9..b6f409f41 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 |