fix config problems preventing UE to start
This commit is contained in:
@@ -129,20 +129,21 @@ int i;
|
||||
|
||||
/* default */
|
||||
if (cfgparam == NULL) {
|
||||
cfgparam = "libconfig:oaisoftmodem.conf";
|
||||
tmpflags = tmpflags | CONFIG_NOOOPT;
|
||||
cfgparam = DEFAULT_CFGMODE ":" DEFAULT_CFGFILENAME;
|
||||
}
|
||||
/* parse the config parameters to set the config source */
|
||||
i = sscanf(cfgparam,"%m[^':']:%ms",&cfgmode,&modeparams);
|
||||
if (i< 0) {
|
||||
fprintf(stderr,"[CONFIG] %s, %d, sscanf error parsing config source %s: %s\n", __FILE__, __LINE__,cfgparam, strerror(errno));
|
||||
cfgmode=strdup("libconfig");
|
||||
modeparams = strdup("oaisoftmodem.conf");
|
||||
cfgmode=strdup(DEFAULT_CFGMODE);
|
||||
modeparams = strdup(DEFAULT_CFGFILENAME);
|
||||
}
|
||||
else if ( i == 1 ) {
|
||||
/* -O argument doesn't contain ":" separator, assume -O <conf file> option, default cfgmode to libconfig
|
||||
with one parameter, the path to the configuration file */
|
||||
modeparams=cfgmode;
|
||||
cfgmode=strdup("libconfig");
|
||||
cfgmode=strdup(DEFAULT_CFGMODE);
|
||||
}
|
||||
|
||||
cfgptr = malloc(sizeof(configmodule_interface_t));
|
||||
|
||||
@@ -46,6 +46,7 @@
|
||||
#define CONFIG_DEBUGCMDLINE 4 // print command line processing messages
|
||||
#define CONFIG_HELP 8 // print help message
|
||||
#define CONFIG_ABORT 16 // config failed,abort execution
|
||||
#define CONFIG_NOOOPT 32 // no -O option found when parsing command line
|
||||
|
||||
|
||||
typedef int(*configmodule_initfunc_t)(char *cfgP[],int numP);
|
||||
|
||||
@@ -38,6 +38,9 @@
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
#define DEFAULT_CFGFILENAME "oaisoftmodem.conf"
|
||||
#define DEFAULT_CFGMODE "libconfig"
|
||||
|
||||
#define CONFIG_GETSOURCE ( (config_get_if()==NULL) ? NULL : config_get_if()->cfgmode )
|
||||
#define CONFIG_GETNUMP ( (config_get_if()==NULL) ? 0 : config_get_if()->num_cfgP )
|
||||
#define CONFIG_GETP(P) ( (config_get_if()==NULL) ? NULL : config_get_if()->cfgP[P] )
|
||||
|
||||
Reference in New Issue
Block a user