From 5113baa1759663de2a4dc93d29f536c542f984d4 Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Tue, 22 Mar 2011 23:17:13 +0100 Subject: [PATCH] Fixes the stat operation of a directory in Windows --- portable.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/portable.h b/portable.h index 87128149..9dbd93f8 100644 --- a/portable.h +++ b/portable.h @@ -122,6 +122,7 @@ #define HAVE_FSYNC 1 #define fsync _commit #define rename windows_rename +#define mkdir(a, b) mkdir(a) /** * Generic stat information. @@ -194,7 +195,7 @@ static inline int windows_stat(const char* file, struct windows_stat* st) BY_HANDLE_FILE_INFORMATION info; HANDLE h; - h = CreateFile(file, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, 0, OPEN_EXISTING, 0, 0); + h = CreateFile(file, GENERIC_READ, FILE_SHARE_READ, 0, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0); if (h == INVALID_HANDLE_VALUE) { DWORD error = GetLastError(); switch (error) {