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);
int MsgRmRf(char *pDirPath)
{
struct dirent *d = NULL;
- struct dirent entry;
DIR *dir;
dir = opendir(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);
if (path != NULL)
free(path);
+ if (errno != 0)
+ return -1;
+
return 0;
}
unsigned int MsgDu(const char *pDirPath)
{
struct dirent *d = NULL;
- struct dirent entry;
DIR *dir;
dir = opendir(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);
free(path);
+ if (errno != 0)
+ return 0;
+
return totalFileSize;
}
void MsgMmsInitDir()
{
struct dirent *d = NULL;
- struct dirent entry;
DIR* dir = NULL;
dir = opendir(MSG_DATA_PATH);
}
/* 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;