summaryrefslogtreecommitdiff
path: root/src/iterator.c
diff options
context:
space:
mode:
authorTomás Pollak <tomaspollak@gmail.com>2018-01-30 23:21:19 -0300
committerGitHub <noreply@github.com>2018-01-30 23:21:19 -0300
commit752006dd9a617466adc50fca1587e5e6325954fd (patch)
tree814fe671b95ae67c552c7b3294c9111cc0cbae2c /src/iterator.c
parent895fd51a434ac50ebd53e996bd9149302ca3e134 (diff)
downloadlibgit2-752006dd9a617466adc50fca1587e5e6325954fd.tar.gz
Honor 'GIT_USE_NSEC' option in `filesystem_iterator_set_current`
This should have been part of PR #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’
Diffstat (limited to 'src/iterator.c')
-rw-r--r--src/iterator.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/iterator.c b/src/iterator.c
index 132b2c77c..36c68a152 100644
--- a/src/iterator.c
+++ b/src/iterator.c
@@ -1458,10 +1458,12 @@ static void filesystem_iterator_set_current(
filesystem_iterator_entry *entry)
{
iter->entry.ctime.seconds = entry->st.st_ctime;
- iter->entry.ctime.nanoseconds = entry->st.st_ctime_nsec;
-
iter->entry.mtime.seconds = entry->st.st_mtime;
+
+#if defined(GIT_USE_NSEC)
+ iter->entry.ctime.nanoseconds = entry->st.st_ctime_nsec;
iter->entry.mtime.nanoseconds = entry->st.st_mtime_nsec;
+#endif
iter->entry.dev = entry->st.st_dev;
iter->entry.ino = entry->st.st_ino;