summaryrefslogtreecommitdiff
path: root/nuttx/fs
diff options
context:
space:
mode:
Diffstat (limited to 'nuttx/fs')
-rw-r--r--nuttx/fs/fat/fs_fat32.c18
-rw-r--r--nuttx/fs/fat/fs_fat32util.c14
2 files changed, 16 insertions, 16 deletions
diff --git a/nuttx/fs/fat/fs_fat32.c b/nuttx/fs/fat/fs_fat32.c
index 640292145..25354e936 100644
--- a/nuttx/fs/fat/fs_fat32.c
+++ b/nuttx/fs/fat/fs_fat32.c
@@ -2092,9 +2092,9 @@ static int fat_stat(struct inode *mountpt, const char *relpath, struct stat *buf
{
struct fat_mountpt_s *fs;
struct fat_dirinfo_s dirinfo;
- uint16_t date;
+ uint16_t fatdate;
uint16_t date2;
- uint16_t time;
+ uint16_t fattime;
uint8_t attribute;
int ret;
@@ -2174,12 +2174,12 @@ static int fat_stat(struct inode *mountpt, const char *relpath, struct stat *buf
/* Times */
- date = DIR_GETWRTDATE(dirinfo.fd_entry);
- time = DIR_GETWRTTIME(dirinfo.fd_entry);
- buf->st_mtime = fat_fattime2systime(time, date);
+ fatdate = DIR_GETWRTDATE(dirinfo.fd_entry);
+ fattime = DIR_GETWRTTIME(dirinfo.fd_entry);
+ buf->st_mtime = fat_fattime2systime(fattime, fatdate);
date2 = DIR_GETLASTACCDATE(dirinfo.fd_entry);
- if (date == date2)
+ if (fatdate == date2)
{
buf->st_atime = buf->st_mtime;
}
@@ -2188,9 +2188,9 @@ static int fat_stat(struct inode *mountpt, const char *relpath, struct stat *buf
buf->st_atime = fat_fattime2systime(0, date2);
}
- date = DIR_GETCRDATE(dirinfo.fd_entry);
- time = DIR_GETCRTIME(dirinfo.fd_entry);
- buf->st_ctime = fat_fattime2systime(time, date);
+ fatdate = DIR_GETCRDATE(dirinfo.fd_entry);
+ fattime = DIR_GETCRTIME(dirinfo.fd_entry);
+ buf->st_ctime = fat_fattime2systime(fattime, fatdate);
ret = OK;
diff --git a/nuttx/fs/fat/fs_fat32util.c b/nuttx/fs/fat/fs_fat32util.c
index aa327543b..aa8db91d5 100644
--- a/nuttx/fs/fat/fs_fat32util.c
+++ b/nuttx/fs/fat/fs_fat32util.c
@@ -1895,8 +1895,8 @@ int fat_dirtruncate(struct fat_mountpt_s *fs, struct fat_dirinfo_s *dirinfo)
int fat_dircreate(struct fat_mountpt_s *fs, struct fat_dirinfo_s *dirinfo)
{
uint8_t *direntry;
- uint32_t time;
- int ret;
+ uint32_t fattime;
+ int ret;
/* Set up the directory entry */
@@ -1924,11 +1924,11 @@ int fat_dircreate(struct fat_mountpt_s *fs, struct fat_dirinfo_s *dirinfo)
/* ARCHIVE attribute, write time, creation time */
DIR_PUTATTRIBUTES(dirinfo->fd_entry, FATATTR_ARCHIVE);
- time = fat_systime2fattime();
- DIR_PUTWRTTIME(dirinfo->fd_entry, time & 0xffff);
- DIR_PUTCRTIME(dirinfo->fd_entry, time & 0xffff);
- DIR_PUTWRTDATE(dirinfo->fd_entry, time >> 16);
- DIR_PUTCRDATE(dirinfo->fd_entry, time >> 16);
+ fattime = fat_systime2fattime();
+ DIR_PUTWRTTIME(dirinfo->fd_entry, fattime & 0xffff);
+ DIR_PUTCRTIME(dirinfo->fd_entry, fattime & 0xffff);
+ DIR_PUTWRTDATE(dirinfo->fd_entry, fattime >> 16);
+ DIR_PUTCRDATE(dirinfo->fd_entry, fattime >> 16);
fs->fs_dirty = true;
return OK;