M350b版本
This commit is contained in:
@ -48,15 +48,10 @@ T_DjiReturnCode Osal_FileOpen(const char *fileName, const char *fileMode, T_DjiF
|
||||
|
||||
*fileObj = fopen(fileName, fileMode);
|
||||
if (*fileObj == NULL) {
|
||||
goto out;
|
||||
return DJI_ERROR_SYSTEM_MODULE_CODE_SYSTEM_ERROR;
|
||||
}
|
||||
|
||||
return DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
|
||||
|
||||
out:
|
||||
free(*fileObj);
|
||||
|
||||
return DJI_ERROR_SYSTEM_MODULE_CODE_SYSTEM_ERROR;
|
||||
}
|
||||
|
||||
T_DjiReturnCode Osal_FileClose(T_DjiFileHandle fileObj)
|
||||
@ -266,7 +261,7 @@ T_DjiReturnCode Osal_Stat(const char *filePath, T_DjiFileInfo *fileInfo)
|
||||
return DJI_ERROR_SYSTEM_MODULE_CODE_SYSTEM_ERROR;
|
||||
}
|
||||
|
||||
fileTm = localtime(&(st.st_ctime));
|
||||
fileTm = localtime((const time_t *) &(st.st_mtim));
|
||||
if (fileTm == NULL) {
|
||||
return DJI_ERROR_SYSTEM_MODULE_CODE_SYSTEM_ERROR;
|
||||
}
|
||||
@ -274,7 +269,7 @@ T_DjiReturnCode Osal_Stat(const char *filePath, T_DjiFileInfo *fileInfo)
|
||||
fileInfo->size = st.st_size;
|
||||
|
||||
fileInfo->createTime.year = fileTm->tm_year + 1900 - 1980;
|
||||
fileInfo->createTime.month = fileTm->tm_mon;
|
||||
fileInfo->createTime.month = fileTm->tm_mon + 1;
|
||||
fileInfo->createTime.day = fileTm->tm_mday;
|
||||
fileInfo->createTime.hour = fileTm->tm_hour;
|
||||
fileInfo->createTime.minute = fileTm->tm_min;
|
||||
|
||||
Reference in New Issue
Block a user