Change deprecated api(readdir_r -> readdir) 53/106853/1
authorSuyeon Hwang <stom.hwang@samsung.com>
Fri, 23 Dec 2016 08:28:42 +0000 (17:28 +0900)
committerSuyeon Hwang <stom.hwang@samsung.com>
Fri, 23 Dec 2016 08:28:42 +0000 (17:28 +0900)
Change-Id: I64a910b280301347bda9eb7f5a1c8de509999a06
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
client/stt_file.c [changed mode: 0644->0755]
common/stt_config_mgr.c [changed mode: 0644->0755]
engine-parser/src/stt-engine-parser.c
server/sttd_server.c [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index 11b4a35..030829f
@@ -359,16 +359,11 @@ int stt_file_initialize(void)
        /* Get file name from default engine directory */
        DIR *dp = NULL;
        int ret = -1;
-       struct dirent entry;
        struct dirent *dirp = NULL;
        dp  = opendir(STT_DEFAULT_ENGINE);
        if (NULL != dp) {
                do {
-                       ret = readdir_r(dp, &entry, &dirp);
-                       if (0 != ret) {
-                               SLOG(LOG_ERROR, TAG_STTFC, "[File ERROR] 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 d7e3105..b7cf83b
@@ -657,8 +657,6 @@ int __stt_config_mgr_check_engine_is_valid(const char* engine_id)
 static void __get_engine_list(const char* directory)
 {
        DIR *dp = NULL;
-       int ret = -1;
-       struct dirent entry;
        struct dirent *dirp = NULL;
 
        if (NULL == directory) {
@@ -669,11 +667,7 @@ static void __get_engine_list(const char* directory)
        dp  = opendir(directory);
        if (NULL != dp) {
                do {
-                       ret = readdir_r(dp, &entry, &dirp);
-                       if (0 != ret) {
-                               SLOG(LOG_ERROR, stt_tag(), "[File ERROR] Fail to read directory");
-                               break;
-                       }
+                       dirp = readdir(dp);
 
                        if (NULL != dirp) {
                                if (!strcmp(".", dirp->d_name) || !strcmp("..", dirp->d_name))
index 52a89dd..a7d297d 100755 (executable)
@@ -150,7 +150,7 @@ static void __insert_language_from_metadata(xmlNodePtr root, const char *languag
        languages_node = xmlNewNode(NULL, (const xmlChar*)STT_TAG_ENGINE_LANGUAGE_SET);
 
        lang = strsep(&tmp_lang, ",");
-       while(NULL != lang) {
+       while (NULL != lang) {
                LOGD("lang (%s)", lang);
                lang_node = xmlNewNode(NULL, (const xmlChar*)STT_TAG_ENGINE_LANGUAGE);
                xmlNodeSetContent(lang_node, (const xmlChar*)lang);
@@ -171,7 +171,7 @@ int PKGMGR_MDPARSER_PLUGIN_INSTALL(const char *pkgid, const char *appid, GList *
        uid_t uid = 0;
        int ret = -1;
        ret = pkgmgr_installer_info_get_target_uid(&uid);
-       if (ret < 0 ) {
+       if (ret < 0) {
                LOGE("[ERROR] Fail to get target uid");
                return 0;
        } else {
old mode 100644 (file)
new mode 100755 (executable)
index d2f0bf2..591dd6d
@@ -542,9 +542,7 @@ int sttd_finalize()
 static void __read_proc()
 {
        DIR *dp = NULL;
-       struct dirent entry;
        struct dirent *dirp = NULL;
-       int ret = -1;
        int tmp;
 
        GList *iter = NULL;
@@ -561,11 +559,7 @@ static void __read_proc()
                SLOG(LOG_ERROR, TAG_STTD, "[ERROR] Fail to open proc");
        } else {
                do {
-                       ret = readdir_r(dp, &entry, &dirp);
-                       if (0 != ret) {
-                               SLOG(LOG_ERROR, TAG_STTD, "[ERROR] Fail to readdir");
-                               break;
-                       }
+                       dirp = readdir(dp);
 
                        if (NULL != dirp) {
                                tmp = atoi(dirp->d_name);