mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2024-11-23 12:16:38 +00:00
15 lines
251 B
Go
15 lines
251 B
Go
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
|
|
}
|
|
}
|