summaryrefslogtreecommitdiff
path: root/vendor/modernc.org/libc/ioutil_linux.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2021-11-27 15:26:58 +0100
committerLibravatar GitHub <noreply@github.com>2021-11-27 15:26:58 +0100
commit182b4eea73881c611a0f519576aa6ad2aa6799c2 (patch)
tree230fac469690fcee8797b13585e739be148d4789 /vendor/modernc.org/libc/ioutil_linux.go
parentRequire confirmed email when checking oauth token (#332) (diff)
downloadgotosocial-182b4eea73881c611a0f519576aa6ad2aa6799c2.tar.xz
Update dependencies (#333)
Diffstat (limited to 'vendor/modernc.org/libc/ioutil_linux.go')
-rw-r--r--vendor/modernc.org/libc/ioutil_linux.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/vendor/modernc.org/libc/ioutil_linux.go b/vendor/modernc.org/libc/ioutil_linux.go
index 7b23807fe..608857f21 100644
--- a/vendor/modernc.org/libc/ioutil_linux.go
+++ b/vendor/modernc.org/libc/ioutil_linux.go
@@ -43,13 +43,14 @@ 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, err int) {
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
}