aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2011-07-23 13:54:34 +0000
committerdrh <drh@noemail.net>2011-07-23 13:54:34 +0000
commit5d22e41f2d0aaa5c824c62c4cfb498de6e2ac2f2 (patch)
tree55e09390843e47fd91d0244ecd916cb36cfa3c4a /src
parent11cce770424f1d76220f20a654e8c21a84757e25 (diff)
parentfdf6db12a458aa5e93a64829833870371c662a2d (diff)
downloadsqlite-5d22e41f2d0aaa5c824c62c4cfb498de6e2ac2f2.tar.gz
sqlite-5d22e41f2d0aaa5c824c62c4cfb498de6e2ac2f2.zip
Merge the winAccess retry logic from the anti-antivirus branch
into the trunk. FossilOrigin-Name: 08d0e8799e1441ef063b1cdf9e4107071a0f81ca
Diffstat (limited to 'src')
-rw-r--r--src/os_common.h9
-rw-r--r--src/os_win.c6
2 files changed, 10 insertions, 5 deletions
diff --git a/src/os_common.h b/src/os_common.h
index eba856be8..aa3e18a8c 100644
--- a/src/os_common.h
+++ b/src/os_common.h
@@ -30,10 +30,13 @@
#endif
#ifdef SQLITE_DEBUG
-int sqlite3OSTrace = 0;
-#define OSTRACE(X) if( sqlite3OSTrace ) sqlite3DebugPrintf X
+# ifndef SQLITE_DEBUG_OS_TRACE
+# define SQLITE_DEBUG_OS_TRACE 0
+# endif
+ int sqlite3OSTrace = SQLITE_DEBUG_OS_TRACE;
+# define OSTRACE(X) if( sqlite3OSTrace ) sqlite3DebugPrintf X
#else
-#define OSTRACE(X)
+# define OSTRACE(X)
#endif
/*
diff --git a/src/os_win.c b/src/os_win.c
index 2d4f0adad..5d9bf5984 100644
--- a/src/os_win.c
+++ b/src/os_win.c
@@ -2452,11 +2452,13 @@ static int winAccess(
return SQLITE_NOMEM;
}
if( isNT() ){
+ int cnt = 0;
WIN32_FILE_ATTRIBUTE_DATA sAttrData;
memset(&sAttrData, 0, sizeof(sAttrData));
- if( GetFileAttributesExW((WCHAR*)zConverted,
+ while( (rc = GetFileAttributesExW((WCHAR*)zConverted,
GetFileExInfoStandard,
- &sAttrData) ){
+ &sAttrData)) && rc==0 && retryIoerr(&cnt) ){}
+ if( rc ){
/* For an SQLITE_ACCESS_EXISTS query, treat a zero-length file
** as if it does not exist.
*/