summaryrefslogtreecommitdiff
path: root/firmware/drivers/fat.c
diff options
context:
space:
mode:
authorJames Buren <braewoods+rb@braewoods.net>2021-07-08 17:45:57 +0000
committerJames Buren <braewoods+rb@braewoods.net>2021-07-08 17:47:51 +0000
commita9f36efa62c0f095994e2a711a689b3b3e81aea2 (patch)
treeeebaf4a08f4b74997bd69f87dae7d0ef6ab8acbb /firmware/drivers/fat.c
parenta0f1236e882fb20611c17b1e2275505f70ba8ed4 (diff)
downloadrockbox-a9f36efa62c0f095994e2a711a689b3b3e81aea2.tar.gz
rockbox-a9f36efa62c0f095994e2a711a689b3b3e81aea2.zip
file/fat: rework utime function as modtime extension
This eliminates the dependence on a special struct since we were only using the modtime anyway. But it no longer fits any known standard APIs so I have converted it to our own extension instead. This can still be adapted to existing hosted APIs if the need arises. Change-Id: Ic8800698ddfd3a1a48b7cf921c0d0f865302d034
Diffstat (limited to 'firmware/drivers/fat.c')
-rw-r--r--firmware/drivers/fat.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/firmware/drivers/fat.c b/firmware/drivers/fat.c
index 28d4eb1987..0c02c8224f 100644
--- a/firmware/drivers/fat.c
+++ b/firmware/drivers/fat.c
@@ -2276,8 +2276,8 @@ fat_error:
2276 return rc; 2276 return rc;
2277} 2277}
2278 2278
2279int fat_utime(struct fat_file *parent, struct fat_file *file, 2279int fat_modtime(struct fat_file *parent, struct fat_file *file,
2280 const struct utimbuf *times) 2280 time_t modtime)
2281{ 2281{
2282 struct bpb * const fat_bpb = FAT_BPB(parent->volume); 2282 struct bpb * const fat_bpb = FAT_BPB(parent->volume);
2283 2283
@@ -2297,7 +2297,7 @@ int fat_utime(struct fat_file *parent, struct fat_file *file,
2297 2297
2298 uint16_t date; 2298 uint16_t date;
2299 uint16_t time; 2299 uint16_t time;
2300 dostime_localtime(times->modtime, &date, &time); 2300 dostime_localtime(modtime, &date, &time);
2301 2301
2302 ent->wrttime = htole16(time); 2302 ent->wrttime = htole16(time);
2303 ent->wrtdate = htole16(date); 2303 ent->wrtdate = htole16(date);