Fixes the stat operation of a directory in Windows

This commit is contained in:
Andrea Mazzoleni 2011-03-22 23:17:13 +01:00
parent cc968a94ec
commit 5113baa175

View file

@ -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) {