Skip to content

Commit 778f271

Browse files
tklausergopherbot
authored andcommitted
syscall: handle errors.ErrUnsupported in isNotSupported
Updates #41198 Change-Id: Ifed913f6088b77abc7a21d2a79168a20799f9d0e Reviewed-on: https://go-review.googlesource.com/c/go/+/475857 Run-TryBot: Tobias Klauser <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Bryan Mills <[email protected]> Auto-Submit: Tobias Klauser <[email protected]>
1 parent bbf795e commit 778f271

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/syscall/exec_linux_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ func isNotSupported(err error) bool {
3939
switch errno {
4040
case syscall.ENOSYS, syscall.ENOTSUP:
4141
// Explicitly not supported.
42+
// TODO(#41198): remove these cases when errors.Is reports that they are
43+
// equivalent to ErrUnsupported.
4244
return true
4345
case syscall.EPERM, syscall.EROFS:
4446
// User lacks permission: either the call requires root permission and the
@@ -51,12 +53,10 @@ func isNotSupported(err error) bool {
5153
}
5254
}
5355

54-
if errors.Is(err, fs.ErrPermission) {
56+
if errors.Is(err, fs.ErrPermission) || errors.Is(err, errors.ErrUnsupported) {
5557
return true
5658
}
5759

58-
// TODO(#41198): Also return true if errors.Is(err, errors.ErrUnsupported).
59-
6060
return false
6161
}
6262

0 commit comments

Comments
 (0)