From: Tobias Klauser Date: Thu, 16 Mar 2023 18:23:34 +0000 (+0100) Subject: syscall: let errors.ErrUnsupported match ERROR_NOT_SUPPORTED and ERROR_CALL_NOT_IMPLE... X-Git-Tag: go1.21rc1~1245 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=964985362b4d8702a16bce08c7a825488ccb9601;p=gostls13.git syscall: let errors.ErrUnsupported match ERROR_NOT_SUPPORTED and ERROR_CALL_NOT_IMPLEMENTED These error codes are returned on windows in case a particular functions is not supported. Updates #41198 Change-Id: Ic31755a131d4e7c96961ba54f5bb51026fc7a563 Reviewed-on: https://go-review.googlesource.com/c/go/+/476916 Auto-Submit: Tobias Klauser Reviewed-by: Bryan Mills Reviewed-by: Ian Lance Taylor Run-TryBot: Tobias Klauser TryBot-Result: Gopher Robot --- diff --git a/src/syscall/syscall_windows.go b/src/syscall/syscall_windows.go index fe052d7e72..9f660c1f52 100644 --- a/src/syscall/syscall_windows.go +++ b/src/syscall/syscall_windows.go @@ -142,7 +142,11 @@ func (e Errno) Error() string { return string(utf16.Decode(b[:n])) } -const _ERROR_BAD_NETPATH = Errno(53) +const ( + _ERROR_NOT_SUPPORTED = Errno(50) + _ERROR_BAD_NETPATH = Errno(53) + _ERROR_CALL_NOT_IMPLEMENTED = Errno(120) +) func (e Errno) Is(target error) bool { switch target { @@ -162,7 +166,9 @@ func (e Errno) Is(target error) bool { e == ERROR_PATH_NOT_FOUND || e == ENOENT case errorspkg.ErrUnsupported: - return e == ENOSYS || + return e == _ERROR_NOT_SUPPORTED || + e == _ERROR_CALL_NOT_IMPLEMENTED || + e == ENOSYS || e == ENOTSUP || e == EOPNOTSUPP || e == EWINDOWS