From 874b9d08c169fcc47d0c13f401fa6c63f360a9d0 Mon Sep 17 00:00:00 2001 From: Suyeon Hwang Date: Fri, 23 Dec 2016 17:26:33 +0900 Subject: [PATCH] Change deprecated api(readdir_r -> readdir) Change-Id: I2ddffe4758041c8af9dbac2c5f1119cb1a14782e Signed-off-by: Suyeon Hwang --- common/vc_config_mgr.c | 10 ++-------- server/vcd_engine_agent.c | 8 +------- server/vcd_server.c | 16 ++-------------- 3 files changed, 5 insertions(+), 29 deletions(-) mode change 100644 => 100755 common/vc_config_mgr.c mode change 100644 => 100755 server/vcd_engine_agent.c mode change 100644 => 100755 server/vcd_server.c diff --git a/common/vc_config_mgr.c b/common/vc_config_mgr.c old mode 100644 new mode 100755 index 822f81d..961a3b6 --- a/common/vc_config_mgr.c +++ b/common/vc_config_mgr.c @@ -535,9 +535,7 @@ int vc_config_mgr_initialize(int uid) /* Get file name from default engine directory */ DIR *dp = NULL; - int ret = -1; - struct dirent entry; - struct dirent *dirp = NULL; + struct dirent *dirp; g_engine_list = NULL; @@ -561,11 +559,7 @@ int vc_config_mgr_initialize(int uid) dp = opendir(VC_DEFAULT_ENGINE_INFO); if (NULL != dp) { do { - ret = readdir_r(dp, &entry, &dirp); - if (0 != ret) { - SLOG(LOG_ERROR, vc_config_tag(), "[File ERROR] Fail to read directory"); - break; - } + dirp = readdir(dp); if (NULL != dirp) { if (!strcmp(".", dirp->d_name) || !strcmp("..", dirp->d_name)) diff --git a/server/vcd_engine_agent.c b/server/vcd_engine_agent.c old mode 100644 new mode 100755 index 12f5754..3d9ec29 --- a/server/vcd_engine_agent.c +++ b/server/vcd_engine_agent.c @@ -414,18 +414,12 @@ int __internal_update_engine_list() /* Get file name from default engine directory */ DIR *dp = NULL; - int ret = -1; - struct dirent entry; struct dirent *dirp = NULL; dp = opendir(VC_DEFAULT_ENGINE); if (NULL != dp) { do { - ret = readdir_r(dp, &entry, &dirp); - if (0 != ret) { - SLOG(LOG_ERROR, TAG_VCD, "[File ERROR] Fail to read directory"); - break; - } + dirp = readdir(dp); if (NULL != dirp) { if (!strcmp(".", dirp->d_name) || !strcmp("..", dirp->d_name)) diff --git a/server/vcd_server.c b/server/vcd_server.c old mode 100644 new mode 100755 index 7787e21..bdef2f0 --- a/server/vcd_server.c +++ b/server/vcd_server.c @@ -865,8 +865,6 @@ static void __vcd_file_clean_up() SLOG(LOG_DEBUG, TAG_VCD, "== Old file clean up == "); DIR *dp = NULL; - int ret = -1; - struct dirent entry; struct dirent *dirp = NULL; dp = opendir(VC_RUNTIME_INFO_ROOT); @@ -877,11 +875,7 @@ static void __vcd_file_clean_up() char remove_path[256] = {0, }; do { - ret = readdir_r(dp, &entry, &dirp); - if (0 != ret) { - SLOG(LOG_ERROR, TAG_VCD, "[File ERROR] Fail to read directory"); - break; - } + dirp = readdir(dp); if (NULL != dirp) { if (!strncmp("vc_", dirp->d_name, strlen("vc_"))) { @@ -1033,9 +1027,7 @@ static Eina_Bool __finalize_quit_ecore_loop(void *data) static void __read_proc() { DIR *dp = NULL; - struct dirent entry; struct dirent *dirp = NULL; - int ret = -1; int tmp; GList *iter = NULL; @@ -1052,11 +1044,7 @@ static void __read_proc() SLOG(LOG_ERROR, TAG_VCD, "[ERROR] Fail to open proc"); } else { do { - ret = readdir_r(dp, &entry, &dirp); - if (0 != ret) { - SLOG(LOG_ERROR, TAG_VCD, "[ERROR] Fail to readdir"); - break; - } + dirp = readdir(dp); if (NULL != dirp) { tmp = atoi(dirp->d_name); -- 2.7.4