summaryrefslogtreecommitdiff
path: root/vendor/github.com/ncruces/go-sqlite3/vfs/os_darwin.go
diff options
context:
space:
mode:
authorLibravatar kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com>2024-08-15 00:30:58 +0000
committerLibravatar GitHub <noreply@github.com>2024-08-15 00:30:58 +0000
commit586639ccf0e2fefbd1da2c59d5abcb8d64d37434 (patch)
tree52a9d7412e98ef406c39f09a6fad6e3fa7a7ad49 /vendor/github.com/ncruces/go-sqlite3/vfs/os_darwin.go
parentupdate go-ffmpreg to v0.2.5 (pulls in latest tetratelabs/wazero) (#3203) (diff)
downloadgotosocial-586639ccf0e2fefbd1da2c59d5abcb8d64d37434.tar.xz
update go-sqlite3 to v0.18.0 (#3204)
Diffstat (limited to 'vendor/github.com/ncruces/go-sqlite3/vfs/os_darwin.go')
-rw-r--r--vendor/github.com/ncruces/go-sqlite3/vfs/os_darwin.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/vendor/github.com/ncruces/go-sqlite3/vfs/os_darwin.go b/vendor/github.com/ncruces/go-sqlite3/vfs/os_darwin.go
index 8bfe96bb1..c8d84dc36 100644
--- a/vendor/github.com/ncruces/go-sqlite3/vfs/os_darwin.go
+++ b/vendor/github.com/ncruces/go-sqlite3/vfs/os_darwin.go
@@ -5,6 +5,7 @@ package vfs
import (
"io"
"os"
+ "runtime"
"time"
"golang.org/x/sys/unix"
@@ -68,7 +69,7 @@ func osUnlock(file *os.File, start, len int64) _ErrorCode {
}
func osLock(file *os.File, typ int16, start, len int64, timeout time.Duration, def _ErrorCode) _ErrorCode {
- lock := flocktimeout_t{fl: unix.Flock_t{
+ lock := &flocktimeout_t{fl: unix.Flock_t{
Type: typ,
Start: start,
Len: len,
@@ -82,6 +83,7 @@ func osLock(file *os.File, typ int16, start, len int64, timeout time.Duration, d
default:
lock.timeout = unix.NsecToTimespec(int64(timeout / time.Nanosecond))
err = unix.FcntlFlock(file.Fd(), _F_OFD_SETLKWTIMEOUT, &lock.fl)
+ runtime.KeepAlive(lock)
}
return osLockErrorCode(err, def)
}