From a40cd32e24e18857ab937e1142fe4146334b455c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paulius=20Ratkevi=C4=8Dius?= Date: Sun, 19 May 2019 16:19:04 +0300 Subject: daemon: Settings actually parse. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Paulius Ratkevičius --- src/daemon/settings.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/daemon') diff --git a/src/daemon/settings.c b/src/daemon/settings.c index 355fe1d..855d4bb 100644 --- a/src/daemon/settings.c +++ b/src/daemon/settings.c @@ -126,14 +126,13 @@ static int setting_readconf(const char * const path) return 0; } -/* TODO: stub! */ static int setting_handle_config_entry(const char * const entry, const char * const value) { size_t i; for (i = 0; i < sizeof(ent_table)/sizeof(*ent_table); ++i) { if (!(strcmp(entry, ent_table[i].name))) { - ent_table[0].set(value); + ent_table[i].set(value); return 0; } } @@ -148,14 +147,16 @@ static void set_daemonize(const void * const arg) atoi(a) ? set_flag(flag_daemonize) : unset_flag(flag_daemonize); } -/* TODO: stub! */ static void set_port(const void * const arg) { - (void) arg; + const char * const a = arg; + + settings.port = strtoul(a, NULL, 0); } -/* TODO: stub! */ static void set_verbosity(const void * const arg) { - (void) arg; + const char * const a = arg; + + settings.verboselevel = strtol(a, NULL, 0); } -- cgit v1.2.3