UG_TRACE_BEGIN;
DIR *pDir = NULL;
struct dirent *ent;
+ struct dirent ent_struct;
ug_mf_retvm_if(path == NULL, MYFILE_ERR_INVALID_ARG, "path is null");
ug_mf_retvm_if(dir_list == NULL, MYFILE_ERR_INVALID_ARG, "dir_list is null");
if (pDir == NULL) {
return MYFILE_ERR_DIR_OPEN_FAIL;
}
-
- while ((ent = readdir(pDir)) != NULL) {
+ while ((readdir_r(pDir, &ent_struct, &ent) == 0) && ent) {
GString *childpath = NULL;
ugFsNodeInfo *pNode = NULL;
{
struct stat info = {0,};
struct dirent *dp = NULL;
+ struct dirent ent_struct;
DIR *dirp = NULL;
dirp = opendir(path);
return -1;
}
- while ((dp = readdir(dirp))) {
+ while ((readdir_r(dirp, &ent_struct, &dp) == 0) && dp) {
if (stat(dp->d_name, &info) == 0 && (strcmp(dp->d_name, ".")) && (strcmp(dp->d_name, ".."))) {
closedir(dirp);
return 0;
char *f = NULL;
DIR *dirp = NULL;
struct dirent *dp = NULL;
+ struct dirent ent_struct;
Eina_List *list = NULL;
dirp = opendir(dir);
return NULL;
}
- while ((dp = readdir(dirp))) {
+ while ((readdir_r(dirp, &ent_struct, &dp) == 0) && dp) {
if ((strcmp(dp->d_name , ".")) && (strcmp(dp->d_name , ".."))) {
f = strdup(dp->d_name);
list = eina_list_append(list, f);
{
char buf[PATH_MAX_SIZE] = {0,};
struct dirent *dp = NULL;
+ struct dirent ent_struct;
DIR *dirp = NULL;
if (readlink(dir, buf, sizeof(buf)) > 0) {
ret = 1;
dirp = opendir(dir);
if (dirp) {
- while ((dp = readdir(dirp))) {
+ while ((readdir_r(dirp, &ent_struct, &dp) == 0) && dp) {
if ((strcmp(dp->d_name , ".")) && (strcmp(dp->d_name, ".."))) {
if (!mf_file_recursive_rm(dp->d_name)) {
ret = 0;
{
DIR *directory = NULL;
GList *candidate = NULL;
-
+ struct dirent ent_struct;
char *up_needle = NULL;
char *up_name = NULL;
gboolean multi_ext_flag = FALSE;
result->current_dir = g_strdup(root);
__mf_ug_search_thread_unlock(handle);
multi_ext_flag = __mf_ug_search_NFD_is_multi_ext(needle);
- while ((entry = readdir(directory)) != NULL) {
+ while ((readdir_r(directory, &ent_struct, &entry) == 0) && entry) {
if (!(option & MF_SEARCH_OPT_HIDDEN) && (0 == strncmp(entry->d_name, ".", 1))) {
SECURE_DEBUG("[%s] is hidden file. Skip it", entry->d_name);
continue;