chore(deps): Update sqlite dependencies

This commit is contained in:
TwiN
2022-12-01 20:19:56 -05:00
parent 080563bd4f
commit cdec353744
564 changed files with 583632 additions and 1166555 deletions

View File

@ -43,19 +43,20 @@ func nextRandom(x uintptr) {
copy((*RawMem)(unsafe.Pointer(x))[:6:6], fmt.Sprintf("%06d", int(1e9+r%1e9)%1e6))
}
func tempFile(s, x uintptr) (fd, err int) {
func tempFile(s, x uintptr, flags int32) (fd int, err error) {
const maxTry = 10000
nconflict := 0
flags |= int32(os.O_RDWR | os.O_CREATE | os.O_EXCL | unix.O_LARGEFILE)
for i := 0; i < maxTry; i++ {
nextRandom(x)
fdcwd := fcntl.AT_FDCWD
n, _, err := unix.Syscall6(unix.SYS_OPENAT, uintptr(fdcwd), s, uintptr(os.O_RDWR|os.O_CREATE|os.O_EXCL|unix.O_LARGEFILE), 0600, 0, 0)
n, _, err := unix.Syscall6(unix.SYS_OPENAT, uintptr(fdcwd), s, uintptr(flags), 0600, 0, 0)
if err == 0 {
return int(n), 0
return int(n), nil
}
if err != errno.EEXIST {
return -1, int(err)
return -1, err
}
if nconflict++; nconflict > 10 {
@ -65,5 +66,5 @@ func tempFile(s, x uintptr) (fd, err int) {
randStateMu.Unlock()
}
}
return -1, errno.EEXIST
return -1, unix.Errno(errno.EEXIST)
}