fix: circular reference problem

This commit is contained in:
wlynxg 2023-08-28 12:21:49 +08:00
parent a64399c21a
commit ad4f8ff11f
1 changed files with 3 additions and 2 deletions

View File

@ -7,7 +7,8 @@
package syscall
import (
"os"
err2 "errors"
"io/fs"
"runtime"
"sync"
"unsafe"
@ -68,7 +69,7 @@ func NetlinkRIB(proto, family int) ([]byte, error) {
sa := &SockaddrNetlink{Family: AF_NETLINK}
if err := Bind(s, sa); err != nil {
// Bind operation of Netlink socket is prohibited in Android11 and later versions
if !(runtime.GOOS == "android" && os.IsPermission(err)) {
if !(runtime.GOOS == "android" && err2.Is(err, fs.ErrPermission)) {
return nil, err
}
}