diff options
Diffstat (limited to 'firmware/target/hosted/filesystem-unix.c')
-rw-r--r-- | firmware/target/hosted/filesystem-unix.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/firmware/target/hosted/filesystem-unix.c b/firmware/target/hosted/filesystem-unix.c index 177cb574e0..f0d7de640d 100644 --- a/firmware/target/hosted/filesystem-unix.c +++ b/firmware/target/hosted/filesystem-unix.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <sys/stat.h> | 23 | #include <sys/stat.h> |
24 | #include <string.h> | 24 | #include <string.h> |
25 | #include <errno.h> | 25 | #include <errno.h> |
26 | #include <utime.h> | ||
26 | #include "config.h" | 27 | #include "config.h" |
27 | #include "system.h" | 28 | #include "system.h" |
28 | #include "file.h" | 29 | #include "file.h" |
@@ -35,6 +36,17 @@ | |||
35 | #define SAME_FILE_INFO(sb1p, sb2p) \ | 36 | #define SAME_FILE_INFO(sb1p, sb2p) \ |
36 | ((sb1p)->st_dev == (sb2p)->st_dev && (sb1p)->st_ino == (sb2p)->st_ino) | 37 | ((sb1p)->st_dev == (sb2p)->st_dev && (sb1p)->st_ino == (sb2p)->st_ino) |
37 | 38 | ||
39 | int os_modtime(const char *path, time_t modtime) | ||
40 | { | ||
41 | struct utimbuf times = | ||
42 | { | ||
43 | .actime = modtime, | ||
44 | .modtime = modtime, | ||
45 | }; | ||
46 | |||
47 | return utime(path, ×); | ||
48 | } | ||
49 | |||
38 | off_t os_filesize(int osfd) | 50 | off_t os_filesize(int osfd) |
39 | { | 51 | { |
40 | struct stat sb; | 52 | struct stat sb; |