remove build warning with updated toolchain 61/107261/2
authorKyeonghun Lee <kh9090.lee@samsung.com>
Tue, 27 Dec 2016 08:55:01 +0000 (17:55 +0900)
committerKyeonghun Lee <kh9090.lee@samsung.com>
Tue, 27 Dec 2016 09:57:59 +0000 (18:57 +0900)
Change-Id: If1ae78f6bca013304309221948a77861dc91b972
Signed-off-by: Kyeonghun Lee <kh9090.lee@samsung.com>
framework/submit-handler/MsgSubmitHandler.cpp
utils/MsgUtilFile.cpp

index 1f48ce8..68ff678 100755 (executable)
@@ -104,10 +104,10 @@ msg_error_t MsgSubmitReqSMS(MSG_REQUEST_INFO_S *pReqInfo)
        if (pReqInfo->msgInfo.msgPort.valid == false) {
                pReqInfo->msgInfo.folderId = MSG_OUTBOX_ID;
 
-       if (pReqInfo->msgInfo.msgId > 0 && (pReqInfo->msgInfo.folderId == MSG_DRAFT_ID || pReqInfo->msgInfo.folderId == MSG_OUTBOX_ID))
-               err = MsgStoUpdateMessage(&(pReqInfo->msgInfo), &(pReqInfo->sendOptInfo));
-               if (err != MSG_SUCCESS)
-                       return err;
+               if (pReqInfo->msgInfo.msgId > 0 && (pReqInfo->msgInfo.folderId == MSG_DRAFT_ID || pReqInfo->msgInfo.folderId == MSG_OUTBOX_ID))
+                       err = MsgStoUpdateMessage(&(pReqInfo->msgInfo), &(pReqInfo->sendOptInfo));
+                       if (err != MSG_SUCCESS)
+                               return err;
        }
 
        err = plg->submitReq(pReqInfo);
index 510d8f1..c7e4b03 100755 (executable)
@@ -804,7 +804,6 @@ __CATCH:
 int MsgRmRf(char *pDirPath)
 {
        struct dirent *d = NULL;
-       struct dirent entry;
        DIR *dir;
 
        dir = opendir(pDirPath);
@@ -826,7 +825,8 @@ int MsgRmRf(char *pDirPath)
 
        bzero(path, size);
 
-       for (readdir_r(dir, &entry, &d); d != NULL; readdir_r(dir, &entry, &d)) {
+       errno = 0;
+       while ((d = readdir(dir)) != NULL) {
                if (d->d_type == DT_DIR) {
                        snprintf(path, size, "%s/%s", pDirPath, d->d_name);
 
@@ -870,6 +870,9 @@ int MsgRmRf(char *pDirPath)
        if (path != NULL)
                free(path);
 
+       if (errno != 0)
+               return -1;
+
        return 0;
 }
 
@@ -891,7 +894,6 @@ int MsgGetFileSize(const char *pFileName)
 unsigned int MsgDu(const char *pDirPath)
 {
        struct dirent *d = NULL;
-       struct dirent entry;
        DIR *dir;
 
        dir = opendir(pDirPath);
@@ -912,7 +914,8 @@ unsigned int MsgDu(const char *pDirPath)
 
        unsigned int totalFileSize = 0;
 
-       for (readdir_r(dir, &entry, &d); d != NULL; readdir_r(dir, &entry, &d)) {
+       errno = 0;
+       while ((d = readdir(dir)) != NULL) {
                if(d->d_type == DT_DIR) {
                        snprintf(path, size, "%s/%s", pDirPath, d->d_name);
 
@@ -949,6 +952,9 @@ unsigned int MsgDu(const char *pDirPath)
 
        free(path);
 
+       if (errno != 0)
+               return 0;
+
        return totalFileSize;
 }
 
@@ -992,7 +998,6 @@ bool MsgAppendFile(const char *pFilePath, const char *pData, int DataSize)
 void MsgMmsInitDir()
 {
        struct dirent *d = NULL;
-       struct dirent entry;
        DIR* dir = NULL;
 
        dir = opendir(MSG_DATA_PATH);
@@ -1003,7 +1008,7 @@ void MsgMmsInitDir()
        }
 
        /* Remove temporal Mms folder */
-       for (readdir_r(dir, &entry, &d); d != NULL; readdir_r(dir, &entry, &d)) {
+       while ((d = readdir(dir)) != NULL) {
                if (d->d_type == DT_DIR) {
                        if ((strcmp(".", d->d_name) == 0) || (strcmp("..", d->d_name) == 0))
                                continue;