diff options
author | 2019-05-19 16:19:04 +0300 | |
---|---|---|
committer | 2019-05-19 16:48:31 +0300 | |
commit | a40cd32e24e18857ab937e1142fe4146334b455c (patch) | |
tree | e5391cd0cde12bef67f6852ab99603537893eaf9 | |
parent | bd427117a36715cc602e85869cd7d6db6415a945 (diff) | |
download | usurpation-a40cd32e24e18857ab937e1142fe4146334b455c.tar.gz usurpation-a40cd32e24e18857ab937e1142fe4146334b455c.tar.bz2 usurpation-a40cd32e24e18857ab937e1142fe4146334b455c.zip |
daemon: Settings actually parse.
Signed-off-by: Paulius Ratkevičius <paulius.ratkevicius@ktu.edu>
-rw-r--r-- | src/daemon/settings.c | 13 |
1 files changed, 7 insertions, 6 deletions
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); } |