aboutsummaryrefslogtreecommitdiff
path: root/src/os_unix.c
diff options
context:
space:
mode:
authordan <dan@noemail.net>2018-01-09 20:34:53 +0000
committerdan <dan@noemail.net>2018-01-09 20:34:53 +0000
commit9898c4a0c4ebe63f4ce5bacc8e133c83240c06e6 (patch)
tree8985266d9fb47ba3d3a7337bd325a155946b4709 /src/os_unix.c
parentc48e0271f63cce3a122b4e94f95efc5c3a02556a (diff)
downloadsqlite-9898c4a0c4ebe63f4ce5bacc8e133c83240c06e6.tar.gz
sqlite-9898c4a0c4ebe63f4ce5bacc8e133c83240c06e6.zip
In the os_unix.c implementation of xOpen(), do not return
SQLITE_READONLY_DIRECTORY in cases where the file cannot be opened for reasons other than a readonly directory, such as the process running out of file descriptors. FossilOrigin-Name: fa8b80bb967792de99808712ac03e37ace0f11eb8fbe444aacd3d19184c425ea
Diffstat (limited to 'src/os_unix.c')
-rw-r--r--src/os_unix.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/os_unix.c b/src/os_unix.c
index 2d377ef56..3b2b2e2a5 100644
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -5917,7 +5917,9 @@ static int unixOpen(
rc = unixLogError(SQLITE_CANTOPEN_BKPT, "open", zName);
/* If unable to create a journal, change the error code to
** indicate that the directory permissions are wrong. */
- if( isNewJrnl && osAccess(zName, F_OK) ) rc = SQLITE_READONLY_DIRECTORY;
+ if( isNewJrnl && errno==EACCES && osAccess(zName, F_OK) ){
+ rc = SQLITE_READONLY_DIRECTORY;
+ }
goto open_finished;
}