Merge the winAccess retry logic from the anti-antivirus branch

into the trunk.

FossilOrigin-Name: 08d0e8799e1441ef063b1cdf9e4107071a0f81ca
This commit is contained in:
drh
2011-07-23 13:54:34 +00:00
4 changed files with 18 additions and 13 deletions
+6 -3
View File
@@ -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
/*
+4 -2
View File
@@ -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.
*/