This libgo patch declares the return type of the C getaddrinfo function, when called from Go, as int32 rather than int. That is important because getaddrinfo returns negative numbers on error, and so numbers like -2 in int32 were being treated as 0xfffffffe in int, which in Go is a 64 bit type. This caused comparisons against EAI_NONAME, etc., to fail. This fixes https://golang.org/issue/23645. Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu. Committed to mainline.
Ian
Index: gcc/go/gofrontend/MERGE =================================================================== --- gcc/go/gofrontend/MERGE (revision 257280) +++ gcc/go/gofrontend/MERGE (working copy) @@ -1,4 +1,4 @@ -71758f9ca1804743afe178f0e2fca489e0217474 +b833695618d1a5d9d531f5ba0f9c07c7e35e0073 The first line of this file holds the git revision number of the last merge done from the gofrontend repository. Index: libgo/go/net/cgo_unix.go =================================================================== --- libgo/go/net/cgo_unix.go (revision 257217) +++ libgo/go/net/cgo_unix.go (working copy) @@ -23,7 +23,7 @@ import ( ) //extern getaddrinfo -func libc_getaddrinfo(node *byte, service *byte, hints *syscall.Addrinfo, res **syscall.Addrinfo) int +func libc_getaddrinfo(node *byte, service *byte, hints *syscall.Addrinfo, res **syscall.Addrinfo) int32 //extern freeaddrinfo func libc_freeaddrinfo(res *syscall.Addrinfo)