diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2024-04-19 14:50:48 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2024-04-19 15:50:45 -0400 |
commit | 48d91c62cd27c15fe0e928abf6d023d17e9c41f7 (patch) | |
tree | a6dd2dfb7acddb2e45bdbdddf4fced3ae0155e15 /src/stat.c | |
parent | 111cc3af4b6132fda47d18683a04985ca7c571c2 (diff) | |
download | bfs-48d91c62cd27c15fe0e928abf6d023d17e9c41f7.tar.xz |
config: Check for struct stat::st_{a,c,m,birth}{tim,timespec}
Diffstat (limited to 'src/stat.c')
-rw-r--r-- | src/stat.c | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -104,18 +104,21 @@ void bfs_stat_convert(struct bfs_stat *dest, const struct stat *src) { dest->mask |= BFS_STAT_ATTRS; #endif - dest->atime = src->st_atim; + dest->atime = ST_ATIM(*src); dest->mask |= BFS_STAT_ATIME; - dest->ctime = src->st_ctim; + dest->ctime = ST_CTIM(*src); dest->mask |= BFS_STAT_CTIME; - dest->mtime = src->st_mtim; + dest->mtime = ST_MTIM(*src); dest->mask |= BFS_STAT_MTIME; -#if __APPLE__ || __FreeBSD__ || __NetBSD__ +#if BFS_HAS_ST_BIRTHTIM dest->btime = src->st_birthtim; dest->mask |= BFS_STAT_BTIME; +#elif BFS_HAS_ST_BIRTHTIMESPEC + dest->btime = src->st_birthtimespec; + dest->mask |= BFS_STAT_BTIME; #endif } |