diff options
author | Alfred E. Heggestad <alfred.heggestad@gmail.com> | 2017-12-17 12:59:18 +0100 |
---|---|---|
committer | Alfred E. Heggestad <alfred.heggestad@gmail.com> | 2017-12-17 12:59:18 +0100 |
commit | 1cc4a0c6d5032dcbccc0f758fe7820db688927fb (patch) | |
tree | eee58c3006fec57d5f05e8eceb3c1e6a3c16cc97 | |
parent | 5370457db5f5c5ac12f6ba6da5418e8ed16a19fb (diff) |
debug_cmd: add command 'conf_reload' to reload configuration file
-rw-r--r-- | modules/debug_cmd/debug_cmd.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/modules/debug_cmd/debug_cmd.c b/modules/debug_cmd/debug_cmd.c index 56c1a8f..faee4ee 100644 --- a/modules/debug_cmd/debug_cmd.c +++ b/modules/debug_cmd/debug_cmd.c @@ -98,6 +98,27 @@ static int cmd_play_file(struct re_printf *pf, void *arg) } +static int reload_config(struct re_printf *pf, void *arg) +{ + int err; + (void)arg; + + err = re_hprintf(pf, "reloading config file ..\n"); + if (err) + return err; + + err = conf_configure(); + if (err) { + (void)re_hprintf(pf, "reload_config failed: %m\n", err); + return err; + } + + (void)re_hprintf(pf, "done\n"); + + return 0; +} + + static const struct cmd debugcmdv[] = { {"main", 0, 0, "Main loop debug", re_debug }, {"config", 0, 0, "Print configuration", cmd_config_print }, @@ -109,6 +130,7 @@ static const struct cmd debugcmdv[] = { {"uastat", 'u', 0, "UA debug", cmd_ua_debug }, {"memstat", 'y', 0, "Memory status", mem_status }, {"play", 0, CMD_PRM, "Play audio file", cmd_play_file }, +{"conf_reload",0, 0, "Reload config file", reload_config }, }; |