diff options
author | gVisor bot <gvisor-bot@google.com> | 2021-11-04 22:01:16 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-11-04 22:01:16 +0000 |
commit | 6a04ee8cefa18c73598714828dbb2a66e7606fc4 (patch) | |
tree | 0453ccd64d728ef765c06eee1651671d573bddd2 /pkg/errors | |
parent | c884dcb8316a261f2af70fd3fbb966b3eab1bfbe (diff) | |
parent | fe8e48fc6d5094fe34783b1040b2ae4ba05349b5 (diff) |
Merge release-20211026.0-34-gfe8e48fc6 (automated)
Diffstat (limited to 'pkg/errors')
-rw-r--r-- | pkg/errors/linuxerr/internal.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/pkg/errors/linuxerr/internal.go b/pkg/errors/linuxerr/internal.go index 127bba0df..87d9ec59c 100644 --- a/pkg/errors/linuxerr/internal.go +++ b/pkg/errors/linuxerr/internal.go @@ -118,3 +118,12 @@ func SyscallRestartErrorFromReturn(rv uintptr) (*errors.Error, bool) { err, ok := restartMap[int(rv)] return err, ok } + +// ConvertIntr converts the provided error code (err) to another one (intr) if +// the first error corresponds to an interrupted operation. +func ConvertIntr(err, intr error) error { + if err == ErrInterrupted { + return intr + } + return err +} |