diff options
author | gVisor bot <gvisor-bot@google.com> | 2019-08-02 20:57:13 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2019-08-02 20:57:13 +0000 |
commit | 15041d177271e6373941d372b8bd2e29db28b125 (patch) | |
tree | 5bd2c0e31b3db71ed053aa483e646f8650b1f76c /runsc/specutils | |
parent | a0ddb482614af1a079ef547adae40bc50810f636 (diff) | |
parent | b461be88a8036ca0455aceb8b6c723d6b6fded4f (diff) |
Merge b461be88 (automated)
Diffstat (limited to 'runsc/specutils')
-rw-r--r-- | runsc/specutils/specutils.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/runsc/specutils/specutils.go b/runsc/specutils/specutils.go index 0b40e38a3..2eec92349 100644 --- a/runsc/specutils/specutils.go +++ b/runsc/specutils/specutils.go @@ -492,3 +492,14 @@ func (c *Cleanup) Clean() { func (c *Cleanup) Release() { c.clean = nil } + +// RetryEintr retries the function until an error different than EINTR is +// returned. +func RetryEintr(f func() (uintptr, uintptr, error)) (uintptr, uintptr, error) { + for { + r1, r2, err := f() + if err != syscall.EINTR { + return r1, r2, err + } + } +} |