update go-sqlite3 to v0.18.0 (#3204)

This commit is contained in:
kim 2024-08-15 00:30:58 +00:00 committed by GitHub
commit 586639ccf0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
36 changed files with 645 additions and 143 deletions

View file

@ -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)
}