From cc8809238b69b8614a1db1ecd1602318a05a259d Mon Sep 17 00:00:00 2001 From: Wèi Cōngruì Date: Tue, 23 Jan 2018 15:56:24 +0800 Subject: 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 Reviewed-by: Ian Lance Taylor Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot --- src/runtime/runtime_linux_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/runtime/runtime_linux_test.go') 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) + } +} -- cgit v1.3-5-g9baa