summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2018-01-31 14:48:42 -0800
committerGitHub <noreply@github.com>2018-01-31 14:48:42 -0800
commit341608dcd47f1c36ed8cb00e84d3e150bdda70fb (patch)
tree6cf42d239766d90875badf25bf20ed2afff458a8
parent9d8510b3bec46a1de7f598a5ab8305be54800b04 (diff)
parent054e4c08d2600c61a4805197381b15830f2762bd (diff)
downloadlibgit2-341608dcd47f1c36ed8cb00e84d3e150bdda70fb.tar.gz
Merge pull request #4507 from tomas/patch-1
Honor 'GIT_USE_NSEC' option in `filesystem_iterator_set_current`
-rw-r--r--src/iterator.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/iterator.c b/src/iterator.c
index 132b2c77c..ff075ce8c 100644
--- a/src/iterator.c
+++ b/src/iterator.c
@@ -1458,10 +1458,15 @@ 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;
+#else
+ iter->entry.ctime.nanoseconds = 0;
+ iter->entry.mtime.nanoseconds = 0;
+#endif
iter->entry.dev = entry->st.st_dev;
iter->entry.ino = entry->st.st_ino;