aboutsummaryrefslogtreecommitdiff
path: root/src/os_unix.c
diff options
context:
space:
mode:
authordrh <>2023-11-17 17:03:45 +0000
committerdrh <>2023-11-17 17:03:45 +0000
commite416251725b886f16a4173714e5fc67ea5e4e424 (patch)
treeaa62e94b0600bed6704cad082bb7bf2cb05d1bbd /src/os_unix.c
parent11e8242e2eec9172d2c47157900638f568813736 (diff)
parentf2bb6ab3fb5a67f2408e1bce102cd75ec51a44cd (diff)
downloadsqlite-e416251725b886f16a4173714e5fc67ea5e4e424.tar.gz
sqlite-e416251725b886f16a4173714e5fc67ea5e4e424.zip
Merge the latest trunk enhancements and fixes into the jsonb branch.
FossilOrigin-Name: 162f0509ef27bcd3ec87629640281a71c773e7c3bbd2cd0df76faf481531e7f1
Diffstat (limited to 'src/os_unix.c')
-rw-r--r--src/os_unix.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/os_unix.c b/src/os_unix.c
index cd3e0fc54..3171b41fd 100644
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -4054,7 +4054,13 @@ static int unixFileControl(sqlite3_file *id, int op, void *pArg){
#ifdef SQLITE_ENABLE_SETLK_TIMEOUT
case SQLITE_FCNTL_LOCK_TIMEOUT: {
int iOld = pFile->iBusyTimeout;
+#if SQLITE_ENABLE_SETLK_TIMEOUT==1
pFile->iBusyTimeout = *(int*)pArg;
+#elif SQLITE_ENABLE_SETLK_TIMEOUT==2
+ pFile->iBusyTimeout = !!(*(int*)pArg);
+#else
+# error "SQLITE_ENABLE_SETLK_TIMEOUT must be set to 1 or 2"
+#endif
*(int*)pArg = iOld;
return SQLITE_OK;
}
@@ -4426,7 +4432,7 @@ static int unixShmSystemLock(
f.l_len = n;
res = osSetPosixAdvisoryLock(pShmNode->hShm, &f, pFile);
if( res==-1 ){
-#ifdef SQLITE_ENABLE_SETLK_TIMEOUT
+#if defined(SQLITE_ENABLE_SETLK_TIMEOUT) && SQLITE_ENABLE_SETLK_TIMEOUT==1
rc = (pFile->iBusyTimeout ? SQLITE_BUSY_TIMEOUT : SQLITE_BUSY);
#else
rc = SQLITE_BUSY;