diff options
author | Stef Walter <stef@memberwebs.com> | 2006-01-28 18:55:22 +0000 |
---|---|---|
committer | Stef Walter <stef@memberwebs.com> | 2006-01-28 18:55:22 +0000 |
commit | cf60f7b59f06308602d2cb4cc72b0b47d2788c16 (patch) | |
tree | dbf2659bbc6951b59f82400440bead0b9e644cfc /daemon/config.c | |
parent | c127605b17195e34a73b7a8c8d401769cdf60795 (diff) |
A few configuration parsing cleanups.
Diffstat (limited to 'daemon/config.c')
-rw-r--r-- | daemon/config.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/daemon/config.c b/daemon/config.c index f45d1f0..e6a61c2 100644 --- a/daemon/config.c +++ b/daemon/config.c @@ -316,7 +316,7 @@ static void config_value(const char* header, const char* name, char* value, config_ctx* ctx) { - if(strcmp(header, "poll") != 0) + if(strcmp(header, CONFIG_POLL) != 0) return; if(strcmp(name, CONFIG_INTERVAL) == 0) @@ -335,7 +335,7 @@ config_value(const char* header, const char* name, char* value, ctx->interval = (uint32_t)i; } - if(strcmp(name, CONFIG_TIMEOUT) == 0) + else if(strcmp(name, CONFIG_TIMEOUT) == 0) { char* t; int i; @@ -352,7 +352,7 @@ config_value(const char* header, const char* name, char* value, } /* If it starts with "field." */ - if(strncmp(name, CONFIG_FIELD, KL(CONFIG_FIELD)) == 0) + else if(strncmp(name, CONFIG_FIELD, KL(CONFIG_FIELD)) == 0) { rb_poller* poll; const char* field; @@ -362,8 +362,8 @@ config_value(const char* header, const char* name, char* value, field = name + KL(CONFIG_FIELD); t = field + strspn(field, FIELD_VALID); if(*t) - err(2, "%s: the '%s' field name must only contain characters, digits, underscore and dash", - ctx->confname, field); + errx(2, "%s: the '%s' field name must only contain characters, digits, underscore and dash", + ctx->confname, field); /* Parse out the field */ parse_item(field, value, ctx); |