Skip to content

Commit 752006d

Browse files
authored
Honor 'GIT_USE_NSEC' option in filesystem_iterator_set_current
This should have been part of PR libgit2#3638. Without this we still get nsec-related errors, even when using -DGIT_USE_NSEC: error: ‘struct stat’ has no member named ‘st_mtime_nsec’
1 parent 895fd51 commit 752006d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/iterator.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1458,10 +1458,12 @@ static void filesystem_iterator_set_current(
14581458
filesystem_iterator_entry *entry)
14591459
{
14601460
iter->entry.ctime.seconds = entry->st.st_ctime;
1461-
iter->entry.ctime.nanoseconds = entry->st.st_ctime_nsec;
1462-
14631461
iter->entry.mtime.seconds = entry->st.st_mtime;
1462+
1463+
#if defined(GIT_USE_NSEC)
1464+
iter->entry.ctime.nanoseconds = entry->st.st_ctime_nsec;
14641465
iter->entry.mtime.nanoseconds = entry->st.st_mtime_nsec;
1466+
#endif
14651467

14661468
iter->entry.dev = entry->st.st_dev;
14671469
iter->entry.ino = entry->st.st_ino;

0 commit comments

Comments
 (0)