aboutsummaryrefslogtreecommitdiffstats
path: root/git-compat-util.h
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2019-05-13 23:50:35 +0900
committerJunio C Hamano <gitster@pobox.com>2019-05-13 23:50:35 +0900
commit40bef4992ea86b79fa80ebd7e6fd19fecdc5879b (patch)
treeef0cb96e86ee1f50cc1d88d65253af1b74c5b77c /git-compat-util.h
parentb51a0fdc3822c2ef260f6d496b6df6d33b101e8a (diff)
parent400caafb2bb63712bb23cfa4d800261aab8e5cae (diff)
downloadgit-40bef4992ea86b79fa80ebd7e6fd19fecdc5879b.tar.gz
Merge branch 'cc/access-on-aix-workaround'
Workaround for standard-compliant but less-than-useful behaviour of access(2) for the root user. * cc/access-on-aix-workaround: git-compat-util: work around for access(X_OK) under root
Diffstat (limited to 'git-compat-util.h')
-rw-r--r--git-compat-util.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/git-compat-util.h b/git-compat-util.h
index fd3460108b..cc0e7e9733 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -1237,12 +1237,22 @@ struct tm *git_gmtime_r(const time_t *, struct tm *);
#ifdef FILENO_IS_A_MACRO
int git_fileno(FILE *stream);
-# ifndef COMPAT_CODE
+# ifndef COMPAT_CODE_FILENO
# undef fileno
# define fileno(p) git_fileno(p)
# endif
#endif
+#ifdef NEED_ACCESS_ROOT_HANDLER
+int git_access(const char *path, int mode);
+# ifndef COMPAT_CODE_ACCESS
+# ifdef access
+# undef access
+# endif
+# define access(path, mode) git_access(path, mode)
+# endif
+#endif
+
/*
* Our code often opens a path to an optional file, to work on its
* contents when we can successfully open it. We can ignore a failure