diff options
author | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2018-02-01 15:49:53 +0000 |
---|---|---|
committer | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2018-02-01 15:49:53 +0000 |
commit | af255290d2a86faa14b78ed97da535402ba70d1e (patch) | |
tree | bb32552e60848302d833efec02bedc82548dad40 /libgo | |
parent | 22db75d788c4db9e1f2c141d8567fa93a3e47368 (diff) |
net: declare lib_getaddrinfo as returning int32
Otherwise on a 64-bit system we will read the 32-bit value as a 64-bit
value. Since getaddrinfo returns negative numbers as error values,
these will be interpreted as numbers like 0xfffffffe rather than -2,
and the comparisons with values like syscall.EAI_NONAME will fail.
Fixes golang/go#23645
Reviewed-on: https://go-review.googlesource.com/91296
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@257299 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgo')
-rw-r--r-- | libgo/go/net/cgo_unix.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libgo/go/net/cgo_unix.go b/libgo/go/net/cgo_unix.go index 5866d384820..5ea13bcba8d 100644 --- a/libgo/go/net/cgo_unix.go +++ b/libgo/go/net/cgo_unix.go @@ -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) |