There might be no source files for the system info database. For
example, when creating hal.img, there might be no /etc/info.ini and
/etc/config/model-config.xml.
- I/O warning : failed to load "/etc/config/model-config.xml":
No such file or directory
- iniparser: cannot open /etc/info.ini
To prevent printing warning log about no such files, check their
existance before parsing them.
In addition, fixed log when there is no given --release argument for
the system_info_update_db(). Previously, it just printed null buffer
after the 'and', making the entire message end with just 'and'.
- Make system info db(/hal/etc/system_info_db) by
/hal/etc/config/model-config.xml and
And it made the following line seem like continued message from the
trailing 'and'. So fixed not to print 'and' when there is no given
--release argument.
Change-Id: Ic7bce9b46f3578b40fb3b07f54d43a36df37cf2f
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
(cherry picked from commit
7849fa13fdc71621fecb8d589ecf7a021be95b7a)
fclose(fp);
}
- if (conf_path && conf_path[0]) {
+ if (conf_path && conf_path[0] && (access(conf_path, F_OK) == 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);
}
- if (release_path && release_path[0]) {
+ if (release_path && release_path[0] && (access(release_path, F_OK) == 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);
}
if (conf_path[0] != '\0' && db_path[0] != '\0') {
- printf("Make system info db(%s) by %s and %s\n", db_path, conf_path, release_path);
+ if (release_path[0])
+ printf("Make system info db(%s) by %s and %s\n", db_path, conf_path, release_path);
+ else
+ printf("Make system info db(%s) by %s\n", db_path, conf_path);
return system_info_create_db(conf_path, release_path, db_path);
}