diff --git a/common/config/config_load_configmodule.c b/common/config/config_load_configmodule.c index 14f4a4c81d..988e993dc6 100644 --- a/common/config/config_load_configmodule.c +++ b/common/config/config_load_configmodule.c @@ -63,7 +63,8 @@ static paramdef_t Config_Params[] = { }; // clang-format on -int load_config_sharedlib(configmodule_interface_t *cfgptr) { +static int load_config_sharedlib(configmodule_interface_t *cfgptr) +{ void *lib_handle; char fname[128]; char libname[FILENAME_MAX]; @@ -380,7 +381,7 @@ configmodule_interface_t *load_configmodule(int argc, Config_Params[idx].strptr = &(cfgptr->tmpdir); config_get(cfgptr, Config_Params, sizeofArray(Config_Params), CONFIG_SECTIONNAME); } else { - fprintf(stderr,"[CONFIG] %s %d config module \"%s\" couldn't be loaded\n", __FILE__, __LINE__,cfgmode); + fprintf(stderr, "[CONFIG] config module \"%s\" couldn't be loaded\n", cfgmode); cfgptr->rtflags = cfgptr->rtflags | CONFIG_HELP | CONFIG_ABORT; } } else { @@ -396,11 +397,6 @@ configmodule_interface_t *load_configmodule(int argc, if (cfgmode != NULL) free(cfgmode); - if (CONFIG_ISFLAGSET(CONFIG_ABORT)) { - config_printhelp(Config_Params, sizeofArray(Config_Params), CONFIG_SECTIONNAME); - // exit(-1); - } - return cfgptr; } diff --git a/executables/nr-softmodem.c b/executables/nr-softmodem.c index 614fecad62..938bbeee88 100644 --- a/executables/nr-softmodem.c +++ b/executables/nr-softmodem.c @@ -514,7 +514,7 @@ int main( int argc, char **argv ) { start_background_system(); ///static configuration for NR at the moment - if ((uniqCfg = load_configmodule(argc, argv, CONFIG_ENABLECMDLINEONLY)) == NULL) { + if ((uniqCfg = load_configmodule(argc, argv, CONFIG_ENABLECMDLINEONLY)) == NULL || CONFIG_ISFLAGSET(CONFIG_ABORT)) { exit_fun("[SOFTMODEM] Error, configuration module init failed\n"); } @@ -528,11 +528,6 @@ int main( int argc, char **argv ) { lock_memory_to_ram(); get_options(uniqCfg); - if (CONFIG_ISFLAGSET(CONFIG_ABORT) ) { - fprintf(stderr,"Getting configuration failed\n"); - exit(-1); - } - if (!has_cap_sys_nice()) LOG_W(UTIL, "no SYS_NICE capability: cannot set thread priority and affinity, consider running with sudo for optimum performance\n"); diff --git a/executables/nr-uesoftmodem.c b/executables/nr-uesoftmodem.c index a0e06850b7..50d3f6946e 100644 --- a/executables/nr-uesoftmodem.c +++ b/executables/nr-uesoftmodem.c @@ -248,7 +248,7 @@ int main(int argc, char **argv) { start_background_system(); - if ((uniqCfg = load_configmodule(argc, argv, CONFIG_ENABLECMDLINEONLY)) == NULL) { + if ((uniqCfg = load_configmodule(argc, argv, CONFIG_ENABLECMDLINEONLY)) == NULL || CONFIG_ISFLAGSET(CONFIG_ABORT)) { exit_fun("[SOFTMODEM] Error, configuration module init failed\n"); } //set_softmodem_sighandler();