1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-15 11:41:13 +03:00

Remove redundant sub-expression from retry loop invariant in winAccess. Also, make check for SQLITE_ACCESS_READWRITE formally correct.

FossilOrigin-Name: 93079a92c49edf72eb289f352cd5ed7ab2faaff3
This commit is contained in:
mistachkin
2011-07-28 19:16:41 +00:00
parent e75a717dc8
commit 4e6b49b409
4 changed files with 12 additions and 11 deletions

View File

@@ -2457,7 +2457,7 @@ static int winAccess(
memset(&sAttrData, 0, sizeof(sAttrData));
while( !(rc = GetFileAttributesExW((WCHAR*)zConverted,
GetFileExInfoStandard,
&sAttrData)) && rc==0 && retryIoerr(&cnt) ){}
&sAttrData)) && retryIoerr(&cnt) ){}
if( rc ){
/* For an SQLITE_ACCESS_EXISTS query, treat a zero-length file
** as if it does not exist.
@@ -2495,7 +2495,8 @@ static int winAccess(
rc = attr!=INVALID_FILE_ATTRIBUTES;
break;
case SQLITE_ACCESS_READWRITE:
rc = (attr & FILE_ATTRIBUTE_READONLY)==0;
rc = attr!=INVALID_FILE_ATTRIBUTES &&
(attr & FILE_ATTRIBUTE_READONLY)==0;
break;
default:
assert(!"Invalid flags argument");