{
return false;
}
- struct dirent store, *entry = NULL;
- while (readdir_r(dir, &store, &entry) == 0 && entry != NULL)
+ struct dirent *entry = NULL;
+ while ((entry = readdir(dir)) != NULL)
{
std::string name( entry->d_name );
if (! include_dot_names && (name[0] == '.') )
DIR* dir = ::opendir( path.c_str());
if (!dir)
return -1;
- struct dirent store, *entry = NULL;
- while (readdir_r(dir, &store, &entry) == 0 && entry != NULL)
+ struct dirent *entry = NULL;
+ while ((entry = readdir(dir)) != NULL)
{
- if (entry->d_name == NULL)
- continue; // should not happen
- else if (! include_dot_names && (entry->d_name)[0] == '.')
+ if (! include_dot_names && (entry->d_name)[0] == '.')
continue;
++result;
}