diff options
Diffstat (limited to 'win32/mingw.c')
-rw-r--r-- | win32/mingw.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/win32/mingw.c b/win32/mingw.c index 7fe5a6f05..ee549c311 100644 --- a/win32/mingw.c +++ b/win32/mingw.c | |||
@@ -286,6 +286,22 @@ static inline int get_file_attr(const char *fname, WIN32_FILE_ATTRIBUTE_DATA *fd | |||
286 | if (GetFileAttributesExA(fname, GetFileExInfoStandard, fdata)) | 286 | if (GetFileAttributesExA(fname, GetFileExInfoStandard, fdata)) |
287 | return 0; | 287 | return 0; |
288 | 288 | ||
289 | if (GetLastError() == ERROR_SHARING_VIOLATION) { | ||
290 | HANDLE hnd; | ||
291 | WIN32_FIND_DATA fd; | ||
292 | |||
293 | if ((hnd=FindFirstFile(fname, &fd)) != INVALID_HANDLE_VALUE) { | ||
294 | fdata->dwFileAttributes = fd.dwFileAttributes; | ||
295 | fdata->ftCreationTime = fd.ftCreationTime; | ||
296 | fdata->ftLastAccessTime = fd.ftLastAccessTime; | ||
297 | fdata->ftLastWriteTime = fd.ftLastWriteTime; | ||
298 | fdata->nFileSizeHigh = fd.nFileSizeHigh; | ||
299 | fdata->nFileSizeLow = fd.nFileSizeLow; | ||
300 | FindClose(hnd); | ||
301 | return 0; | ||
302 | } | ||
303 | } | ||
304 | |||
289 | switch (GetLastError()) { | 305 | switch (GetLastError()) { |
290 | case ERROR_ACCESS_DENIED: | 306 | case ERROR_ACCESS_DENIED: |
291 | case ERROR_SHARING_VIOLATION: | 307 | case ERROR_SHARING_VIOLATION: |