gotosocial/vendor/codeberg.org/gruf/go-store/util/sys.go

15 lines
251 B
Go
Raw Normal View History

2022-01-29 11:15:51 +00:00
package util
import "syscall"
// RetryOnEINTR is a low-level filesystem function for retrying syscalls on O_EINTR received
func RetryOnEINTR(do func() error) error {
for {
err := do()
if err == syscall.EINTR {
continue
}
return err
}
}