diff options
author | hypnotoad <yoda@etoyoc.com> | 2013-04-29 12:31:11 (GMT) |
---|---|---|
committer | hypnotoad <yoda@etoyoc.com> | 2013-04-29 12:31:11 (GMT) |
commit | 7e98e681444fc1b49413624707b811aa45a5b6fa (patch) | |
tree | 9624a61058e7f648dd4d3e730572daf142b344c9 /win/tclWinFile.c | |
parent | f23f5f814767bd8ee631943d6a6840ed563e0dea (diff) | |
parent | 1d75b0eb9444d42e7399a40853deb8bb47a88e4d (diff) | |
download | tcl-hypnotoad_prefer_native_8_6.zip tcl-hypnotoad_prefer_native_8_6.tar.gz tcl-hypnotoad_prefer_native_8_6.tar.bz2 |
Bringing patch up to date with the latest trunkhypnotoad_prefer_native_8_6
Diffstat (limited to 'win/tclWinFile.c')
-rw-r--r-- | win/tclWinFile.c | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/win/tclWinFile.c b/win/tclWinFile.c index 18b05d6..8e517d1 100644 --- a/win/tclWinFile.c +++ b/win/tclWinFile.c @@ -1537,14 +1537,9 @@ NativeAccess( * File might not exist. */ - WIN32_FIND_DATA ffd; - HANDLE hFind; - hFind = FindFirstFile(nativePath, &ffd); - if (hFind != INVALID_HANDLE_VALUE) { - attr = ffd.dwFileAttributes; - FindClose(hFind); - } else { - TclWinConvertError(GetLastError()); + DWORD lasterror = GetLastError(); + if (lasterror != ERROR_SHARING_VIOLATION) { + TclWinConvertError(lasterror); return -1; } } @@ -2002,15 +1997,17 @@ NativeStat( if (GetFileAttributesEx(nativePath, GetFileExInfoStandard, &data) != TRUE) { - /* - * We might have just been denied access - */ - + HANDLE hFind; WIN32_FIND_DATA ffd; - HANDLE hFind = FindFirstFile(nativePath, &ffd); + DWORD lasterror = GetLastError(); + if (lasterror != ERROR_SHARING_VIOLATION) { + TclWinConvertError(lasterror); + return -1; + } + hFind = FindFirstFile(nativePath, &ffd); if (hFind == INVALID_HANDLE_VALUE) { - Tcl_SetErrno(ENOENT); + TclWinConvertError(GetLastError()); return -1; } memcpy(&data, &ffd, sizeof(data)); |