summaryrefslogtreecommitdiff
path: root/vendor/github.com/ncruces/go-sqlite3/vfs/shm_ofd.go
diff options
context:
space:
mode:
authorLibravatar Daenney <daenney@users.noreply.github.com>2024-12-20 22:37:19 +0100
committerLibravatar GitHub <noreply@github.com>2024-12-20 21:37:19 +0000
commit9ae0c7b3636365406b480b494dccc609ccba08b9 (patch)
treeb6a205df8ff83acaff1745ff88885d9346ffef04 /vendor/github.com/ncruces/go-sqlite3/vfs/shm_ofd.go
parent[bugfix] Load instance-wide custom css in page stylesheets template (#3601) (diff)
downloadgotosocial-9ae0c7b3636365406b480b494dccc609ccba08b9.tar.xz
[chore] Update ncruces/go-sqlite3 to 0.21.3 (#3629)
This includes some additional locking fixes for the BSDs.
Diffstat (limited to 'vendor/github.com/ncruces/go-sqlite3/vfs/shm_ofd.go')
-rw-r--r--vendor/github.com/ncruces/go-sqlite3/vfs/shm_ofd.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/vendor/github.com/ncruces/go-sqlite3/vfs/shm_ofd.go b/vendor/github.com/ncruces/go-sqlite3/vfs/shm_ofd.go
index d335a85fc..dd3611193 100644
--- a/vendor/github.com/ncruces/go-sqlite3/vfs/shm_ofd.go
+++ b/vendor/github.com/ncruces/go-sqlite3/vfs/shm_ofd.go
@@ -110,7 +110,12 @@ func (s *vfsShm) shmMap(ctx context.Context, mod api.Module, id, size int32, ext
func (s *vfsShm) shmLock(offset, n int32, flags _ShmFlag) _ErrorCode {
// Argument check.
- if n <= 0 || offset < 0 || offset+n > _SHM_NLOCK {
+ switch {
+ case n <= 0:
+ panic(util.AssertErr())
+ case offset < 0 || offset+n > _SHM_NLOCK:
+ panic(util.AssertErr())
+ case n != 1 && flags&_SHM_EXCLUSIVE == 0:
panic(util.AssertErr())
}
switch flags {
@@ -123,9 +128,6 @@ func (s *vfsShm) shmLock(offset, n int32, flags _ShmFlag) _ErrorCode {
default:
panic(util.AssertErr())
}
- if n != 1 && flags&_SHM_EXCLUSIVE == 0 {
- panic(util.AssertErr())
- }
var timeout time.Duration
if s.blocking {