| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | #include "priv.h" |
| 19 | |
| 20 | error_t |
| 21 | trivfs_set_atime (struct trivfs_control *cntl) |
| 22 | { |
| 23 | struct stat st; |
| 24 | time_value_t atime; |
| 25 | time_value_t mtime; |
| 26 | |
| 27 | io_stat (cntl->underlying, &st); |
| 28 | mtime.seconds = st.st_mtim.tv_sec; |
| 29 | mtime.microseconds = st.st_mtim.tv_nsec / 1000; |
| 30 | atime.microseconds = -1; |
| 31 | file_utimes (cntl->underlying, atime, mtime); |
| Passed-by-value struct argument contains uninitialized data (e.g., field: 'seconds') |
| 32 | return 0; |
| 33 | } |
| 34 | |
| 35 | error_t |
| 36 | trivfs_set_mtime (struct trivfs_control *cntl) |
| 37 | { |
| 38 | struct stat st; |
| 39 | time_value_t atime; |
| 40 | time_value_t mtime; |
| 41 | |
| 42 | io_stat (cntl->underlying, &st); |
| 43 | atime.seconds = st.st_atim.tv_sec; |
| 44 | atime.microseconds = st.st_atim.tv_nsec / 1000; |
| 45 | mtime.microseconds = -1; |
| 46 | file_utimes (cntl->underlying, atime, mtime); |
| 47 | return 0; |
| 48 | } |
| 49 | |
| 50 | |
| 51 | |
| 52 | |