diff options
author | Tomás Pollak <tomaspollak@gmail.com> | 2018-01-30 23:21:19 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-30 23:21:19 -0300 |
commit | 752006dd9a617466adc50fca1587e5e6325954fd (patch) | |
tree | 814fe671b95ae67c552c7b3294c9111cc0cbae2c | |
parent | 895fd51a434ac50ebd53e996bd9149302ca3e134 (diff) | |
download | libgit2-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’
-rw-r--r-- | src/iterator.c | 6 |
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; |