aboutsummaryrefslogtreecommitdiff
path: root/src/os_unix.c
diff options
context:
space:
mode:
authordrh <>2021-06-24 18:23:54 +0000
committerdrh <>2021-06-24 18:23:54 +0000
commitdff34ab96f12640212ef249cba899f172f7d69d4 (patch)
tree2c79f0e19dd1b64aa0993e1549af87575e8c66ab /src/os_unix.c
parentc06836c3b1461afcadfb68b20cbf41f0c41d3105 (diff)
downloadsqlite-dff34ab96f12640212ef249cba899f172f7d69d4.tar.gz
sqlite-dff34ab96f12640212ef249cba899f172f7d69d4.zip
Allow the SQLITE_OPEN_EXCLUSIVE flag in sqlite3_open(). Return the
SQLITE_CANTOPEN_EXISTS extended code to indicate that the open failed because the database already exists. FossilOrigin-Name: d091150ff80709a1e50e0431aa33021f036979e4a88e9769eeec431dfad6d5f5
Diffstat (limited to 'src/os_unix.c')
-rw-r--r--src/os_unix.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/os_unix.c b/src/os_unix.c
index d45fdabab..aa6b3b8e4 100644
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -6185,6 +6185,8 @@ static int unixOpen(
/* If unable to create a journal because the directory is not
** writable, change the error code to indicate that. */
rc = SQLITE_READONLY_DIRECTORY;
+ }else if( errno==EEXIST ){
+ rc = SQLITE_CANTOPEN_EXISTS;
}else if( errno!=EISDIR && isReadWrite ){
/* Failed to open the file for read/write access. Try read-only. */
flags &= ~(SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE);