From 83d90bbc824e5874022a41bbbbe4f34c65876480 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Cl=C3=A9ment=20Chigot?= Date: Fri, 22 Mar 2019 12:52:54 +0100 Subject: [PATCH] syscall: fix returned values of Dup2 on aix/ppc64 Change-Id: Ia78ea589cc6d58ff22f7d519399c06c5308419dd Reviewed-on: https://go-review.googlesource.com/c/go/+/168878 Reviewed-by: Tobias Klauser Run-TryBot: Tobias Klauser --- src/syscall/syscall_aix.go | 2 +- src/syscall/zsyscall_aix_ppc64.go | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/syscall/syscall_aix.go b/src/syscall/syscall_aix.go index 8039da735b..703cbf761c 100644 --- a/src/syscall/syscall_aix.go +++ b/src/syscall/syscall_aix.go @@ -46,7 +46,7 @@ func (ts *StTimespec_t) Nano() int64 { // But, as fcntl is currently not exported and isn't called with F_DUP2FD, // it doesn't matter. //sys fcntl(fd int, cmd int, arg int) (val int, err error) -//sys Dup2(old int, new int) (val int, err error) +//sys Dup2(old int, new int) (err error) //sysnb pipe(p *[2]_C_int) (err error) func Pipe(p []int) (err error) { diff --git a/src/syscall/zsyscall_aix_ppc64.go b/src/syscall/zsyscall_aix_ppc64.go index 52398e60f1..5ee4f49d12 100644 --- a/src/syscall/zsyscall_aix_ppc64.go +++ b/src/syscall/zsyscall_aix_ppc64.go @@ -294,9 +294,8 @@ func fcntl(fd int, cmd int, arg int) (val int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Dup2(old int, new int) (val int, err error) { - r0, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_Dup2)), 2, uintptr(old), uintptr(new), 0, 0, 0, 0) - val = int(r0) +func Dup2(old int, new int) (err error) { + _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_Dup2)), 2, uintptr(old), uintptr(new), 0, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } -- 2.48.1