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

Small simplification to the xOpen method in the unix VFS.

FossilOrigin-Name: 96e7d638ecdabbf84a152036eb01d408d142839e
This commit is contained in:
drh
2015-11-26 02:21:05 +00:00
parent 970942e4fc
commit 5a2d970a1a
3 changed files with 9 additions and 8 deletions

View File

@@ -5746,7 +5746,8 @@ static int unixOpen(
}
fd = robust_open(zName, openFlags, openMode);
OSTRACE(("OPENX %-3d %s 0%o\n", fd, zName, openFlags));
if( fd<0 && errno!=EISDIR && isReadWrite && !isExclusive ){
assert( !isExclusive || (openFlags & O_CREAT)!=0 );
if( fd<0 && errno!=EISDIR && isReadWrite ){
/* Failed to open the file for read/write access. Try read-only. */
flags &= ~(SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE);
openFlags &= ~(O_RDWR|O_CREAT);