summaryrefslogtreecommitdiff
path: root/src/fileops.c
diff options
context:
space:
mode:
authorJacques Germishuys <jacquesg@striata.com>2015-11-20 18:57:13 +0200
committerJacques Germishuys <jacquesg@striata.com>2015-11-20 21:05:38 +0200
commiteb11fac629aa6acee934fc310621ed9a50a200fa (patch)
tree7adced2dc9515530e32062646cd5e885ae1abaf8 /src/fileops.c
parent69d1494873ee170ae33c37943c75bf7fa1c9d89d (diff)
downloadlibgit2-eb11fac629aa6acee934fc310621ed9a50a200fa.tar.gz
Detect stat's structure
Diffstat (limited to 'src/fileops.c')
-rw-r--r--src/fileops.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/fileops.c b/src/fileops.c
index 07eb504bd..6aafd06b6 100644
--- a/src/fileops.c
+++ b/src/fileops.c
@@ -13,6 +13,12 @@
#include "win32/findfile.h"
#endif
+#ifdef GIT_USE_STAT_ATIMESPEC
+#define st_atim st_atimespec
+#define st_ctim st_ctimespec
+#define st_mtim st_mtimespec
+#endif
+
GIT__USE_STRMAP
int git_futils_mkpath2file(const char *file_path, const mode_t mode)
@@ -1034,11 +1040,7 @@ int git_futils_filestamp_check(
git_futils_filestamp *stamp, const char *path)
{
struct stat st;
-#if defined(__APPLE__)
- const struct timespec *statmtime = &st.st_mtimespec;
-#else
const struct timespec *statmtime = &st.st_mtim;
-#endif
/* if the stamp is NULL, then always reload */
if (stamp == NULL)
@@ -1080,11 +1082,7 @@ void git_futils_filestamp_set(
void git_futils_filestamp_set_from_stat(
git_futils_filestamp *stamp, struct stat *st)
{
-#if defined(__APPLE__)
- const struct timespec *statmtime = &st->st_mtimespec;
-#else
const struct timespec *statmtime = &st->st_mtim;
-#endif
if (st) {
stamp->mtime = *statmtime;