std::set<std::string> xmlFiles;
{
glob_t glob_result;
- glob(app_ext_config_pattern.c_str(), GLOB_TILDE, NULL, &glob_result);
- for (unsigned int i = 0; i < glob_result.gl_pathc; ++i) {
- xmlFiles.insert(glob_result.gl_pathv[i]);
+ int ret = glob(app_ext_config_pattern.c_str(),
+ GLOB_TILDE, NULL, &glob_result);
+ if (ret == 0) {
+ for (unsigned int i = 0; i < glob_result.gl_pathc; ++i) {
+ xmlFiles.insert(glob_result.gl_pathv[i]);
+ }
+ globfree(&glob_result);
+ } else {
+ LOG(ERROR) << "Fail to get extension paths, error code : " << ret;
}
- globfree(&glob_result);
}
GList* privileges = nullptr;
BOOST_SCOPE_EXIT_ALL(privileges) {