diff options
author | Wèi Cōngruì <crvv.mail@gmail.com> | 2018-01-23 15:56:24 +0800 |
---|---|---|
committer | Ian Lance Taylor <iant@golang.org> | 2018-04-24 14:10:43 +0000 |
commit | cc8809238b69b8614a1db1ecd1602318a05a259d (patch) | |
tree | ed10a9e482b39a6936e89c3b88c04b9f017105bb /src/runtime/runtime_linux_test.go | |
parent | 665b9b3476ad0a6dc4e578e42e6c63012e23aaa0 (diff) | |
download | go-cc8809238b69b8614a1db1ecd1602318a05a259d.tar.gz go-cc8809238b69b8614a1db1ecd1602318a05a259d.zip |
runtime: fix errno sign for epollctl on mips, mips64 and ppc64
The caller of epollctl expects it to return a negative errno value,
but it returns a positive errno value on mips, mips64 and ppc64.
The change fixes this.
Updates #23446
Change-Id: Ie6372eca6c23de21964caaaa433c9a45ef93531e
Reviewed-on: https://go-review.googlesource.com/89235
Reviewed-by: Carlos Eduardo Seo <cseo@linux.vnet.ibm.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/runtime/runtime_linux_test.go')
-rw-r--r-- | src/runtime/runtime_linux_test.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/runtime/runtime_linux_test.go b/src/runtime/runtime_linux_test.go index 612397293f..17d6fbde46 100644 --- a/src/runtime/runtime_linux_test.go +++ b/src/runtime/runtime_linux_test.go @@ -52,3 +52,12 @@ func TestMincoreErrorSign(t *testing.T) { t.Errorf("mincore = %v, want %v", v, -EINVAL) } } + +func TestEpollctlErrorSign(t *testing.T) { + v := Epollctl(-1, 1, -1, unsafe.Pointer(&struct{}{})) + + const EBADF = 0x09 + if v != -EBADF { + t.Errorf("epollctl = %v, want %v", v, -EBADF) + } +} |