summaryrefslogtreecommitdiff
path: root/compat/cygwin.c
diff options
context:
space:
mode:
Diffstat (limited to 'compat/cygwin.c')
-rw-r--r--compat/cygwin.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/compat/cygwin.c b/compat/cygwin.c
index dfe9b3084f..871b41d23a 100644
--- a/compat/cygwin.c
+++ b/compat/cygwin.c
@@ -1,8 +1,28 @@
+#define CYGWIN_C
#define WIN32_LEAN_AND_MEAN
+#ifdef CYGWIN_V15_WIN32API
#include "../git-compat-util.h"
#include "win32.h"
+#else
+#include <sys/stat.h>
+#include <sys/errno.h>
+#include "win32.h"
+#include "../git-compat-util.h"
+#endif
#include "../cache.h" /* to read configuration */
+/*
+ * Return POSIX permission bits, regardless of core.ignorecygwinfstricks
+ */
+int cygwin_get_st_mode_bits(const char *path, int *mode)
+{
+ struct stat st;
+ if (lstat(path, &st) < 0)
+ return -1;
+ *mode = st.st_mode;
+ return 0;
+}
+
static inline void filetime_to_timespec(const FILETIME *ft, struct timespec *ts)
{
long long winTime = ((long long)ft->dwHighDateTime << 32) +