Skip to content

Commit

Permalink
conf: drop useless checks and unused code
Browse files Browse the repository at this point in the history
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
  • Loading branch information
troglobit committed Jan 1, 2024
1 parent 500223c commit 21008de
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions src/conf.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,26 +43,17 @@ static int checker(uev_ctx_t *ctx, cfg_t *cfg, const char *sect,
for (i = 0; i < num; i++) {
cfg_t *sec = cfg_getnsec(cfg, sect, i);
const char *name = cfg_title(sec);
char arg[(name ? strlen(name) : 0) + 2];
int enabled, period, logmark;
float warn, crit;
char *script;

if (!sec)
continue;

enabled = cfg_getbool(sec, "enabled");
period = cfg_getint(sec, "interval");
logmark = cfg_getbool(sec, "logmark");
warn = cfg_getfloat(sec, "warning");
crit = cfg_getfloat(sec, "critical");
script = cfg_getstr(sec, "script");

if (name)
snprintf(arg, sizeof(arg), " %s", name);
else
arg[0] = 0;

rc += init(ctx, name, enabled ? period : 0, logmark, warn, crit, script);
}

Expand All @@ -83,9 +74,6 @@ static int generic_checker(uev_ctx_t *ctx, cfg_t *cfg)
const char *monitor;
char *script;

if (!sec)
continue;

enabled = cfg_getbool(sec, "enabled");
period = cfg_getint(sec, "interval");
timeout = cfg_getint(sec, "timeout");
Expand Down

0 comments on commit 21008de

Please sign in to comment.