diff --git a/common/config/config_cmdline.c b/common/config/config_cmdline.c index 98c75c1c14..42ea7259c3 100644 --- a/common/config/config_cmdline.c +++ b/common/config/config_cmdline.c @@ -41,11 +41,13 @@ char *tmpval = value; int optisset=0; char defbool[2]="1"; - if ( ((cfgoptions->paramflags &PARAMFLAG_BOOL) == 0) && value == NULL ) { /* not a boolean, argument required */ + if ( value == NULL) { + if( (cfgoptions->paramflags &PARAMFLAG_BOOL) == 0 ) { /* not a boolean, argument required */ fprintf(stderr,"[CONFIG] command line, option %s requires an argument\n",cfgoptions->optname); return 0; - } else { /* boolean value option without argument, set value to true*/ + } else { /* boolean value option without argument, set value to true*/ tmpval = defbool; + } } switch(cfgoptions->type) { @@ -124,8 +126,8 @@ char *cfgpath; if (strcmp(*p, "-h") == 0 || strcmp(*p, "--help") == 0 ) { config_printhelp(cfgoptions,numoptions); } - if (*p[0] == '-') { - + + if (*p[0] == '-') { for(int i=0;i 2) && (strcmp(*p + 2,cfgpath ) == 0 )) ) { pp = *(p+1); - if ( ( pp != NULL ) && (pp[0]!= '-') ) { - p++; - c--; + if ( ( pp != NULL ) && (c>1) && (pp[0]!= '-') ) { + j += processoption(&(cfgoptions[i]), pp); } else { j += processoption(&(cfgoptions[i]), NULL); } - + break; } } /* for */ } /* if (*p[0] == '-') */ diff --git a/common/config/config_load_configmodule.c b/common/config/config_load_configmodule.c index 60bcefad5e..8351d4d82c 100644 --- a/common/config/config_load_configmodule.c +++ b/common/config/config_load_configmodule.c @@ -109,14 +109,14 @@ char *atoken; uint32_t tmpflags=0; int i; - /* first parse the command line to look for the -O option */ opterr=0; - while ((i = getopt(argc, argv, "O:h")) != -1) { - if ( i == 'O' ) { - cfgparam = optarg; + for (i = 0;iget(params, numparams,prefix); diff --git a/openair2/UTIL/LOG/log.c b/openair2/UTIL/LOG/log.c index 02b6598ab6..7ce85f6d8a 100644 --- a/openair2/UTIL/LOG/log.c +++ b/openair2/UTIL/LOG/log.c @@ -113,7 +113,11 @@ void log_getconfig(log_t *g_log) { paramdef_t logparams_verbosity[MAX_LOG_COMPONENTS]; paramdef_t logparams_logfile[MAX_LOG_COMPONENTS]; - config_get( logparams_defaults,sizeof(logparams_defaults)/sizeof(paramdef_t),CONFIG_STRING_LOG_PREFIX); + int ret = config_get( logparams_defaults,sizeof(logparams_defaults)/sizeof(paramdef_t),CONFIG_STRING_LOG_PREFIX); + if (ret <0) { + fprintf(stderr,"[LOG] init aborted, configuration couldn't be performed"); + return; + } memset(logparams_level, 0, sizeof(paramdef_t)*MAX_LOG_COMPONENTS); memset(logparams_verbosity,0, sizeof(paramdef_t)*MAX_LOG_COMPONENTS); memset(logparams_logfile, 0, sizeof(paramdef_t)*MAX_LOG_COMPONENTS); diff --git a/targets/RT/USER/lte-softmodem.c b/targets/RT/USER/lte-softmodem.c index 69765e80c5..5144e911d7 100644 --- a/targets/RT/USER/lte-softmodem.c +++ b/targets/RT/USER/lte-softmodem.c @@ -584,7 +584,7 @@ static void get_options(void) { if(config_isparamset(cmdline_logparams,CMDLINE_GLOGLEVEL_IDX)) { set_glog(glog_level, -1); } - if(config_isparamset(cmdline_logparams,CMDLINE_GLOGLEVEL_IDX)) { + if(config_isparamset(cmdline_logparams,CMDLINE_GLOGVERBO_IDX)) { set_glog(-1, glog_verbosity); } if (start_telnetsrv) { @@ -889,7 +889,6 @@ int main( int argc, char **argv ) if ( load_configmodule(argc,argv) == NULL) { exit_fun("[SOFTMODEM] Error, configuration module init failed\n"); } - #ifdef DEBUG_CONSOLE setvbuf(stdout, NULL, _IONBF, 0); @@ -920,7 +919,6 @@ int main( int argc, char **argv ) } - #if T_TRACER T_init(T_port, T_wait, T_dont_fork); #endif