1
0
mirror of https://github.com/golang/go synced 2024-11-14 06:20:23 -07:00
Change-Id: Ie97323c886c5e1f40db1a39701464a9799635d13
This commit is contained in:
Mateusz Poliwczak 2024-04-12 06:33:34 +02:00
parent df21a22446
commit d13d6d0c95

View File

@ -137,10 +137,12 @@ func cgoLookupServicePort(hints *_C_struct_addrinfo, network, service string) (p
if err == nil { // see golang.org/issue/6232
err = syscall.EMFILE
}
return 0, newDNSError(err, network+"/"+service, "")
case _C_EAI_SERVICE, _C_EAI_NONAME: // Darwin returns EAI_NONAME.
return 0, newDNSError(errUnknownPort, network+"/"+service, "")
default:
return 0, newDNSError(addrinfoErrno(gerrno), network+"/"+service, "")
}
return 0, newDNSError(addrinfoErrno(gerrno), network+"/"+service, "")
}
defer _C_freeaddrinfo(res)
@ -193,8 +195,9 @@ func cgoLookupHostIP(network, name string) (addrs []IPAddr, err error) {
return nil, newDNSError(err, name, "")
case _C_EAI_NONAME, _C_EAI_NODATA:
return nil, newDNSError(errNoSuchHost, name, "")
default:
return nil, newDNSError(addrinfoErrno(gerrno), name, "")
}
return nil, newDNSError(addrinfoErrno(gerrno), name, "")
}
defer _C_freeaddrinfo(res)
@ -271,8 +274,9 @@ func cgoLookupAddrPTR(addr string, sa *_C_struct_sockaddr, salen _C_socklen_t) (
return nil, newDNSError(err, addr, "")
case _C_EAI_NONAME:
return nil, newDNSError(errNoSuchHost, addr, "")
default:
return nil, newDNSError(addrinfoErrno(gerrno), addr, "")
}
return nil, newDNSError(addrinfoErrno(gerrno), addr, "")
}
if i := bytealg.IndexByte(b, 0); i != -1 {
b = b[:i]