mirror of
https://github.com/golang/sys.git
synced 2026-02-08 03:36:03 +03:00
handle EAFNOSUPPORT error returned on AF_CAN
This commit is contained in:
@@ -226,10 +226,12 @@ func Test_anyToSockaddr(t *testing.T) {
|
||||
if tt.skt.domain != 0 {
|
||||
fd, err = Socket(tt.skt.domain, tt.skt.typ, tt.skt.protocol)
|
||||
// Some sockaddr types need specific kernel modules running: if these
|
||||
// are not present we'll get EPROTONOSUPPORT back when trying to create
|
||||
// the socket. Skip the test in this situation.
|
||||
// are not present we'll get EPROTONOSUPPORT/EAFNOSUPPORT back when
|
||||
// trying to create the socket. Skip the test in this situation.
|
||||
if err == EPROTONOSUPPORT {
|
||||
t.Skip("socket family/protocol not supported by kernel")
|
||||
} else if err == EAFNOSUPPORT {
|
||||
t.Skip("socket address family not supported by kernel")
|
||||
} else if err != nil {
|
||||
t.Fatalf("socket(%v): %v", tt.skt, err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user