summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2013-03-19 12:43:21 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2013-03-19 12:43:21 (GMT)
commit5a70331359bc92b4db9825df010a92b9d6fe5b3f (patch)
treef51a799a268a4b02b23477ec47b676542f24f56a /win
parente2b19646a5d830ece42abf44cc6237b1f0a456d5 (diff)
downloadtcl-5a70331359bc92b4db9825df010a92b9d6fe5b3f.zip
tcl-5a70331359bc92b4db9825df010a92b9d6fe5b3f.tar.gz
tcl-5a70331359bc92b4db9825df010a92b9d6fe5b3f.tar.bz2
[Bug 2893771]: file stat fails on locked files on win32.
Diffstat (limited to 'win')
-rw-r--r--win/tclWinFile.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/win/tclWinFile.c b/win/tclWinFile.c
index 8ea6548..8e41096 100644
--- a/win/tclWinFile.c
+++ b/win/tclWinFile.c
@@ -1337,11 +1337,14 @@ NativeAccess(
if (attr == 0xffffffff) {
/*
- * File doesn't exist.
+ * File might not exist.
*/
- TclWinConvertError(GetLastError());
- return -1;
+ DWORD lasterror = GetLastError();
+ if (lasterror != ERROR_SHARING_VIOLATION) {
+ TclWinConvertError(lasterror);
+ return -1;
+ }
}
if (mode == F_OK) {
@@ -1889,8 +1892,11 @@ NativeStat(nativePath, statPtr, checkLinks)
if((*tclWinProcs->getFileAttributesExProc)(nativePath,
GetFileExInfoStandard,
&data) != TRUE) {
- Tcl_SetErrno(ENOENT);
- return -1;
+ DWORD lasterror = GetLastError();
+ if (lasterror != ERROR_SHARING_VIOLATION) {
+ TclWinConvertError(lasterror);
+ return -1;
+ }
}