Skip to content

Commit

Permalink
runtime: report correct error if kevent failed in netpollinit
Browse files Browse the repository at this point in the history
Report the value returned by kevent, not the previously set errno which
is 0.

Found while debugging CL 198544

Change-Id: I854f5418f8ed8e083d909d328501355496c67a53
Reviewed-on: https://go-review.googlesource.com/c/go/+/202777
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
  • Loading branch information
tklauser committed Oct 23, 2019
1 parent ab3f1a2 commit 9fc41cd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/runtime/netpoll_kqueue.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func netpollinit() {
*(*uintptr)(unsafe.Pointer(&ev.ident)) = uintptr(r)
n := kevent(kq, &ev, 1, nil, 0, nil)
if n < 0 {
println("runtime: kevent failed with", -errno)
println("runtime: kevent failed with", -n)
throw("runtime: kevent failed")
}
netpollBreakRd = uintptr(r)
Expand Down

0 comments on commit 9fc41cd

Please sign in to comment.