summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/sentry')
-rw-r--r--pkg/sentry/kernel/task_syscall.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/pkg/sentry/kernel/task_syscall.go b/pkg/sentry/kernel/task_syscall.go
index 2b1d7e114..2b85fe1ca 100644
--- a/pkg/sentry/kernel/task_syscall.go
+++ b/pkg/sentry/kernel/task_syscall.go
@@ -381,7 +381,7 @@ func ExtractErrno(err error, sysno int) int {
case unix.Errno:
return int(err)
case *errors.Error:
- return int(err.Errno())
+ return int(linuxerr.ToUnix(err))
case *memmap.BusError:
// Bus errors may generate SIGBUS, but for syscalls they still
// return EFAULT. See case in task_run.go where the fault is
@@ -395,7 +395,7 @@ func ExtractErrno(err error, sysno int) int {
return ExtractErrno(err.Err, sysno)
default:
if errno, ok := linuxerr.TranslateError(err); ok {
- return int(errno.Errno())
+ return int(linuxerr.ToUnix(errno))
}
}
panic(fmt.Sprintf("Unknown syscall %d error: %v", sysno, err))