From a9f36efa62c0f095994e2a711a689b3b3e81aea2 Mon Sep 17 00:00:00 2001 From: James Buren Date: Thu, 8 Jul 2021 17:45:57 +0000 Subject: 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 --- firmware/drivers/fat.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'firmware/drivers') 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: return rc; } -int fat_utime(struct fat_file *parent, struct fat_file *file, - const struct utimbuf *times) +int fat_modtime(struct fat_file *parent, struct fat_file *file, + time_t modtime) { struct bpb * const fat_bpb = FAT_BPB(parent->volume); @@ -2297,7 +2297,7 @@ int fat_utime(struct fat_file *parent, struct fat_file *file, uint16_t date; uint16_t time; - dostime_localtime(times->modtime, &date, &time); + dostime_localtime(modtime, &date, &time); ent->wrttime = htole16(time); ent->wrtdate = htole16(date); -- cgit v1.2.3