'readdir_r' is deprecated since version 2.24 glibc.
By upgrading TOOLCHAIN for platform, it should be replaced by 'readdir'
Change-Id: I54ad1b8291f5148e2e294cb8219ce11b32f1db6c
Signed-off-by: Inkyun Kil <inkyun.kil@samsung.com>
GList *_debugger_info_load(const char *path)
{
DIR *dp;
- struct dirent dentry;
- struct dirent *result = NULL;
+ struct dirent *dentry = NULL;
GList *list = NULL;
char buf[PATH_MAX];
char *ext;
if (dp == NULL)
return NULL;
- while (readdir_r(dp, &dentry, &result) == 0 && result != NULL) {
- if (dentry.d_name[0] == '.')
+ while ((dentry = readdir(dp)) != NULL) {
+ if (dentry->d_name[0] == '.')
continue;
- ext = strrchr(dentry.d_name, '.');
+ ext = strrchr(dentry->d_name, '.');
if (ext && strcmp(ext, ".debugger") == 0) {
snprintf(buf, sizeof(buf), "%s/%s",
- path, dentry.d_name);
+ path, dentry->d_name);
list = __parse_file(list, buf);
}
}
GList *_launcher_info_load(const char *path)
{
DIR *dp;
- struct dirent dentry;
- struct dirent *result = NULL;
+ struct dirent *dentry = NULL;
GList *list = NULL;
char buf[PATH_MAX];
char *ext;
if (dp == NULL)
return NULL;
- while (readdir_r(dp, &dentry, &result) == 0 && result != NULL) {
- if (dentry.d_name[0] == '.')
+ while ((dentry = readdir(dp)) != NULL) {
+ if (dentry->d_name[0] == '.')
continue;
- ext = strrchr(dentry.d_name, '.');
+ ext = strrchr(dentry->d_name, '.');
if (ext && strcmp(ext, ".launcher") == 0) {
snprintf(buf, sizeof(buf), "%s/%s",
- path, dentry.d_name);
+ path, dentry->d_name);
list = __parse_file(list, buf);
}
}
static int __delete_dir(const char *path)
{
DIR *dp;
- struct dirent dentry;
- struct dirent *result = NULL;
+ struct dirent *dentry = NULL;
char buf[PATH_MAX];
struct stat statbuf;
int ret;
if (dp == NULL)
return -1;
- while (readdir_r(dp, &dentry, &result) == 0 && result) {
- if (!strcmp(dentry.d_name, ".") || !strcmp(dentry.d_name, ".."))
+ while ((dentry = readdir(dp)) != NULL) {
+ if (!strcmp(dentry->d_name, ".") || !strcmp(dentry->d_name, ".."))
continue;
- snprintf(buf, sizeof(buf), "%s/%s", path, dentry.d_name);
+ snprintf(buf, sizeof(buf), "%s/%s", path, dentry->d_name);
ret = stat(buf, &statbuf);
if (ret == 0) {
if (S_ISDIR(statbuf.st_mode))
int _close_all_fds(void)
{
DIR *dp;
- struct dirent dentry;
- struct dirent *result = NULL;
+ struct dirent *dentry = NULL;
int fd;
int max_fd;
return 0;
}
- while (readdir_r(dp, &dentry, &result) == 0 && result) {
- if (!isdigit(dentry.d_name[0]))
+ while ((dentry = readdir(dp)) != NULL) {
+ if (!isdigit(dentry->d_name[0]))
continue;
- fd = atoi(dentry.d_name);
+ fd = atoi(dentry->d_name);
if (fd < 3)
continue;
static void __socket_garbage_collector(void)
{
DIR *dp;
- struct dirent *dentry;
+ struct dirent *dentry = NULL;
char tmp[MAX_LOCAL_BUFSZ];
snprintf(tmp, sizeof(tmp), "/run/aul/apps/%d", getuid());
GList *_loader_info_load(const char *path)
{
DIR *dir_info;
- struct dirent entry;
- struct dirent *result = NULL;
+ struct dirent *entry = NULL;
GList *list = NULL;
char buf[PATH_MAX];
char *ext;
if (dir_info == NULL)
return NULL;
- while (readdir_r(dir_info, &entry, &result) == 0 && result != NULL) {
- if (entry.d_name[0] == '.')
+ while ((entry = readdir(dir_info)) != NULL) {
+ if (entry->d_name[0] == '.')
continue;
- ext = strrchr(entry.d_name, '.');
+ ext = strrchr(entry->d_name, '.');
if (ext && !strcmp(ext, ".loader")) {
- snprintf(buf, sizeof(buf), "%s/%s", path, entry.d_name);
+ snprintf(buf, sizeof(buf), "%s/%s", path, entry->d_name);
list = __parse_file(list, buf);
}
}