use modern POSIX timestamp fields in struct stat ok stsp
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
diff --git a/lib/fileindex.c b/lib/fileindex.c
index 1e59fdb..04443aa 100644
--- a/lib/fileindex.c
+++ b/lib/fileindex.c
@@ -105,10 +105,10 @@ got_fileindex_entry_update(struct got_fileindex_entry *ie,
if ((ie->flags & GOT_FILEIDX_F_NO_FILE_ON_DISK) == 0) {
if (update_timestamps) {
- ie->ctime_sec = sb.st_ctime;
- ie->ctime_nsec = sb.st_ctimensec;
- ie->mtime_sec = sb.st_mtime;
- ie->mtime_nsec = sb.st_mtimensec;
+ ie->ctime_sec = sb.st_ctim.tv_sec;
+ ie->ctime_nsec = sb.st_ctim.tv_nsec;
+ ie->mtime_sec = sb.st_mtim.tv_sec;
+ ie->mtime_nsec = sb.st_mtim.tv_nsec;
}
ie->uid = sb.st_uid;
ie->gid = sb.st_gid;
diff --git a/lib/worktree.c b/lib/worktree.c
index 8afc4c2..3d078a5 100644
--- a/lib/worktree.c
+++ b/lib/worktree.c
@@ -1569,10 +1569,10 @@ xbit_differs(struct got_fileindex_entry *ie, uint16_t st_mode)
static int
stat_info_differs(struct got_fileindex_entry *ie, struct stat *sb)
{
- return !(ie->ctime_sec == sb->st_ctime &&
- ie->ctime_nsec == sb->st_ctimensec &&
- ie->mtime_sec == sb->st_mtime &&
- ie->mtime_nsec == sb->st_mtimensec &&
+ return !(ie->ctime_sec == sb->st_ctim.tv_sec &&
+ ie->ctime_nsec == sb->st_ctim.tv_nsec &&
+ ie->mtime_sec == sb->st_mtim.tv_sec &&
+ ie->mtime_nsec == sb->st_mtim.tv_nsec &&
ie->size == (sb->st_size & 0xffffffff) &&
!xbit_differs(ie, sb->st_mode));
}