This commit removes iniparser's duplicated loads and error messages.
The origianl codes used to call load_conf() multiple times, generating
meaningless error messages.
Signed-off-by: Dongju Chae <dongju.chae@samsung.com>
load_conf_default();
/* Load up config from ini if available */
-
- if (inipath) {
- ini = iniparser_load(inipath);
- if (ini == NULL)
- fprintf(stderr, "Cannot load .ini file (%s)\n", inipath);
- } else {
- ini = iniparser_load(default_ini_path);
- if (ini == NULL)
- fprintf(stderr, "Cannot load .ini file (%s)\n", default_ini_path);
- }
-
+ ini = iniparser_load(inipath != NULL ? inipath : default_ini_path);
if (ini) {
load_conf_ini(ini, &config);
iniparser_freedict(ini);
}
/* Load up config from envvar if available */
-
load_conf_envvar(&config);
return 0;
{
int i;
- load_conf(NULL);
-
pthread_mutex_init(&napi_priv.mutex, NULL);
for (i=0; i<MAX_NUM_DEVICE; i++) {
napi_priv.npu_fd_table[i] = NULL;
int
main (int argc, char **argv)
{
- int ret = 0;
-
testing::InitGoogleTest (&argc, argv);
- ret = RUN_ALL_TESTS();
-
- return ret;
+ return RUN_ALL_TESTS();
}
int
main (int argc, char **argv)
{
- /** NULL is OK because it will load load_conf_default */
- load_conf (argv[1]);
+ load_conf (NULL);
testing::InitGoogleTest (&argc, argv);
int
main (int argc, char **argv)
{
- int ret = 0;
-
- load_conf (argv[1]);
+ load_conf (NULL);
testing::InitGoogleTest (&argc, argv);
- ret = RUN_ALL_TESTS();
-
- return ret;
+ return RUN_ALL_TESTS();
}
int
main (int argc, char **argv)
{
- int ret = 0;
-
- load_conf (argv[1]);
-
testing::InitGoogleTest (&argc, argv);
- ret = RUN_ALL_TESTS();
-
- return ret;
+ return RUN_ALL_TESTS();
}
int
main (int argc, char **argv)
{
- load_conf (argv[1]);
-
testing::InitGoogleTest (&argc, argv);
return RUN_ALL_TESTS();
int
main (int argc, char **argv)
{
- load_conf (argv[1]);
+ load_conf (NULL);
testing::InitGoogleTest (&argc, argv);
int
main (int argc, char **argv)
{
- load_conf (argv[1]);
+ load_conf (NULL);
testing::InitGoogleTest (&argc, argv);