diff options
author | drh <> | 2024-01-08 15:23:45 +0000 |
---|---|---|
committer | drh <> | 2024-01-08 15:23:45 +0000 |
commit | 3e2ffbd476f0366d40df2510b246a88a7c9a1d04 (patch) | |
tree | 26bc9f50b3e20e23a66e0d4d2593266fa9daaa2d /src/os_unix.c | |
parent | f640f79d6f9ae696c1b274ffd2b010080a6b43bc (diff) | |
download | sqlite-3e2ffbd476f0366d40df2510b246a88a7c9a1d04.tar.gz sqlite-3e2ffbd476f0366d40df2510b246a88a7c9a1d04.zip |
Minor change to os_unix.c to facilitate 100% MC/DC testing.
FossilOrigin-Name: 0dfa7b4da134db281c3c4eddb4569c53a450f955f0af2f410e13db801aff4ea2
Diffstat (limited to 'src/os_unix.c')
-rw-r--r-- | src/os_unix.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/os_unix.c b/src/os_unix.c index 21bbd9769..80e6f6ad9 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -5095,7 +5095,7 @@ static int unixShmLock( for(iMutex=ofst; iMutex<ofst+n; iMutex++){ if( flags==(SQLITE_SHM_LOCK|SQLITE_SHM_EXCLUSIVE) ){ rc = sqlite3_mutex_try(pShmNode->aMutex[iMutex]); - if( rc!=SQLITE_OK ) break; + if( rc!=SQLITE_OK ) goto leave_shmnode_mutexes; }else{ sqlite3_mutex_enter(pShmNode->aMutex[iMutex]); } @@ -5104,7 +5104,7 @@ static int unixShmLock( sqlite3_mutex_enter(pShmNode->pShmMutex); #endif - if( rc==SQLITE_OK ){ + if( ALWAYS(rc==SQLITE_OK) ){ if( flags & SQLITE_SHM_UNLOCK ){ /* Case (a) - unlock. */ int bUnlock = 1; @@ -5183,6 +5183,7 @@ static int unixShmLock( /* Drop the mutexes acquired above. */ #ifdef SQLITE_ENABLE_SETLK_TIMEOUT + leave_shmnode_mutexes: for(iMutex--; iMutex>=ofst; iMutex--){ sqlite3_mutex_leave(pShmNode->aMutex[iMutex]); } |