diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/os_common.h | 9 | ||||
-rw-r--r-- | src/os_win.c | 6 |
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. */ |