char file_path[PATH_MAX];
FILE *fp = NULL;
- if (conf_path == NULL)
- conf_path = MODEL_CONFIG_RO_PATH;
-
- if (release_path == NULL)
- release_path = INFO_FILE_PATH;
-
if (db_path == NULL)
- db_path = SYSTEM_INFO_DB_RO_PATH;
+ return -EINVAL;
ret = mkdir(db_path, 0555);
if (ret != 0 && errno != EEXIST) {
fclose(fp);
}
- ret = system_info_get_values_config_xml(db_path, conf_path);
- if (ret < 0)
- _E("Failed to get keys and values from xml(%d)", ret);
+ if (conf_path && conf_path[0]) {
+ ret = system_info_get_values_config_xml(db_path, conf_path);
+ if (ret < 0)
+ _E("Failed to get keys and values from xml(%d)", ret);
+ }
- ret = system_info_get_values_ini(db_path, release_path);
- if (ret < 0)
- _E("Failed to get keys and values from ini(%d)", ret);
+ if (release_path && release_path[0]) {
+ ret = system_info_get_values_ini(db_path, release_path);
+ if (ret < 0)
+ _E("Failed to get keys and values from ini(%d)", ret);
+ }
return 0;
}
}
if (conf_path[0] != '\0' && db_path[0] != '\0') {
- if (release_path[0] == '\0') /* For backward compatibility: in case which hasn't provided -r option */
- strncpy(release_path, INFO_FILE_PATH, sizeof(release_path));
printf("Make system info db(%s) by %s and %s\n", db_path, conf_path, release_path);
return system_info_create_db(conf_path, release_path, db_path);
}
umask(0222);
if (argc == 1)
- return system_info_create_db(NULL, NULL, NULL);
+ return system_info_create_db(MODEL_CONFIG_RO_PATH, INFO_FILE_PATH, SYSTEM_INFO_DB_RO_PATH);
return system_info_update_db(argc, argv);
}