chore(deps): Update sqlite dependencies
This commit is contained in:
11
vendor/modernc.org/libc/ioutil_linux.go
generated
vendored
11
vendor/modernc.org/libc/ioutil_linux.go
generated
vendored
@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user