vendor tsgo
This commit is contained in:
14
tools/tsgo/internal/nativepath/eintr_unix.go
Normal file
14
tools/tsgo/internal/nativepath/eintr_unix.go
Normal file
@@ -0,0 +1,14 @@
|
||||
//go:build linux || darwin
|
||||
|
||||
package nativepath
|
||||
|
||||
import "syscall"
|
||||
|
||||
func ignoringEINTR[T any](fn func() (T, error)) (T, error) {
|
||||
for {
|
||||
v, err := fn()
|
||||
if err != syscall.EINTR { //nolint:errorlint // syscall functions return raw syscall.Errno, never wrapped
|
||||
return v, err
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user