]> Cypherpunks repositories - gostls13.git/commitdiff
syscall: fix returned values of Dup2 on aix/ppc64
authorClément Chigot <clement.chigot@atos.net>
Fri, 22 Mar 2019 11:52:54 +0000 (12:52 +0100)
committerIan Lance Taylor <iant@golang.org>
Fri, 22 Mar 2019 13:50:19 +0000 (13:50 +0000)
Change-Id: Ia78ea589cc6d58ff22f7d519399c06c5308419dd
Reviewed-on: https://go-review.googlesource.com/c/go/+/168878
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>

src/syscall/syscall_aix.go
src/syscall/zsyscall_aix_ppc64.go

index 8039da735be6286a031f11b25de68c8efb4de3d5..703cbf761c56d5e9faf5f56a8dc4397cf1688e86 100644 (file)
@@ -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) {
index 52398e60f11425b630ade9a41161c71ffc386443..5ee4f49d12b657aa2d679b27e9e59b7bd684c875 100644 (file)
@@ -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)
        }