aboutsummaryrefslogtreecommitdiff
path: root/src/os_unix.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2015-11-26 02:21:05 +0000
committerdrh <drh@noemail.net>2015-11-26 02:21:05 +0000
commit5a2d970a1a0e1d2a292ae60552dacbb77c1ca598 (patch)
tree6b7bbc30e15633ef70a67ffaf524ca64a55087da /src/os_unix.c
parent970942e4fc734b8a33c1b7c36849c1843f4c9ef5 (diff)
downloadsqlite-5a2d970a1a0e1d2a292ae60552dacbb77c1ca598.tar.gz
sqlite-5a2d970a1a0e1d2a292ae60552dacbb77c1ca598.zip
Small simplification to the xOpen method in the unix VFS.
FossilOrigin-Name: 96e7d638ecdabbf84a152036eb01d408d142839e
Diffstat (limited to 'src/os_unix.c')
-rw-r--r--src/os_unix.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/os_unix.c b/src/os_unix.c
index 3745827f6..d86a4a745 100644
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -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);