Skip to content

Commit 341608d

Browse files
authored
Merge pull request libgit2#4507 from tomas/patch-1
Honor 'GIT_USE_NSEC' option in `filesystem_iterator_set_current`
2 parents 9d8510b + 054e4c0 commit 341608d

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/iterator.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1458,10 +1458,15 @@ 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+
#else
1467+
iter->entry.ctime.nanoseconds = 0;
1468+
iter->entry.mtime.nanoseconds = 0;
1469+
#endif
14651470

14661471
iter->entry.dev = entry->st.st_dev;
14671472
iter->entry.ino = entry->st.st_ino;

0 commit comments

Comments
 (0)