Skip to content

Commit

Permalink
syscall: handle errors.ErrUnsupported in isNotSupported
Browse files Browse the repository at this point in the history
Updates #41198

Change-Id: Ifed913f6088b77abc7a21d2a79168a20799f9d0e
Reviewed-on: https://go-review.googlesource.com/c/go/+/475857
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
  • Loading branch information
tklauser authored and gopherbot committed Mar 15, 2023
1 parent bbf795e commit 778f271
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/syscall/exec_linux_test.go
Expand Up @@ -39,6 +39,8 @@ func isNotSupported(err error) bool {
switch errno {
case syscall.ENOSYS, syscall.ENOTSUP:
// Explicitly not supported.
// TODO(#41198): remove these cases when errors.Is reports that they are
// equivalent to ErrUnsupported.
return true
case syscall.EPERM, syscall.EROFS:
// User lacks permission: either the call requires root permission and the
Expand All @@ -51,12 +53,10 @@ func isNotSupported(err error) bool {
}
}

if errors.Is(err, fs.ErrPermission) {
if errors.Is(err, fs.ErrPermission) || errors.Is(err, errors.ErrUnsupported) {
return true
}

// TODO(#41198): Also return true if errors.Is(err, errors.ErrUnsupported).

return false
}

Expand Down

0 comments on commit 778f271

Please sign in to comment.