Change-Id: Iad45c3eea70923dc6f42a966b4ed0c62fcb3ebc4
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
bool sensor_loader::get_module_paths(const std::string &dir_path, std::vector<std::string> &paths)
{
- int ret;
DIR *dir = NULL;
- struct dirent entry;
- struct dirent *result;
+ struct dirent *entry;
struct stat buf;
std::string filename;
retvm_if(!dir, false, "Failed to open directory[%s]", dir_path.c_str());
while (true) {
- ret = readdir_r(dir, &entry, &result);
+ entry = readdir(dir);
+ if (!entry) break;
- if (ret != 0)
- continue;
- if (!result)
- break;
-
- filename = std::string(entry.d_name);
+ filename = std::string(entry->d_name);
if (filename == "." || filename == "..")
continue;