Change deprecated api(readdir_r -> readdir) 54/106854/1
authorSuyeon Hwang <stom.hwang@samsung.com>
Fri, 23 Dec 2016 08:29:11 +0000 (17:29 +0900)
committerSuyeon Hwang <stom.hwang@samsung.com>
Fri, 23 Dec 2016 08:29:11 +0000 (17:29 +0900)
Change-Id: Id27b313b1ab32062365bacc35f29f425a1a70c87
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
common/tts_config_mgr.c
server/ttsd_server.c [changed mode: 0644->0755]

index 8259e2c..4b67834 100755 (executable)
@@ -746,8 +746,6 @@ void __tts_config_release_engine()
 int __tts_config_mgr_get_engine_info()
 {
        DIR *dp = NULL;
-       int ret = -1;
-       struct dirent entry;
        struct dirent *dirp = NULL;
 
        char filepath[512] = {'\0',};
@@ -764,11 +762,7 @@ int __tts_config_mgr_get_engine_info()
                SLOG(LOG_DEBUG, tts_tag(), "[CONFIG] No default directory : %s", TTS_DEFAULT_ENGINE_INFO);
        } else {
                do {
-                       ret = readdir_r(dp, &entry, &dirp);
-                       if (0 != ret) {
-                               SLOG(LOG_ERROR, tts_tag(), "[CONFIG] Fail to read directory");
-                               break;
-                       }
+                       dirp = readdir(dp);
 
                        if (NULL != dirp) {
                                if (!strcmp(".", dirp->d_name) || !strcmp("..", dirp->d_name))
@@ -806,11 +800,7 @@ int __tts_config_mgr_get_engine_info()
                SLOG(LOG_DEBUG, tts_tag(), "[CONFIG] No downloadable directory : %s", TTS_DOWNLOAD_ENGINE_INFO);
        } else {
                do {
-                       ret = readdir_r(dp, &entry, &dirp);
-                       if (0 != ret) {
-                               SLOG(LOG_ERROR, tts_tag(), "[CONFIG] Fail to read directory");
-                               break;
-                       }
+                       dirp = readdir(dp);
 
                        if (NULL != dirp) {
                                if (!strcmp(".", dirp->d_name) || !strcmp("..", dirp->d_name))
old mode 100644 (file)
new mode 100755 (executable)
index 8c7c4dd..d2dd19c
@@ -564,9 +564,7 @@ static Eina_Bool __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;
@@ -584,11 +582,7 @@ static void __read_proc()
                SLOG(LOG_ERROR, tts_tag(), "[ERROR] Fail to open proc");
        } else {
                do {
-                       ret = readdir_r(dp, &entry, &dirp);
-                       if (0 != ret) {
-                               SLOG(LOG_ERROR, tts_tag(), "[ERROR] Fail to readdir");
-                               break;
-                       }
+                       dirp = readdir(dp);
 
                        if (NULL != dirp) {
                                tmp = atoi(dirp->d_name);