]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: report correct error if kevent failed in netpollinit
authorTobias Klauser <tklauser@distanz.ch>
Wed, 23 Oct 2019 06:58:49 +0000 (08:58 +0200)
committerTobias Klauser <tobias.klauser@gmail.com>
Wed, 23 Oct 2019 08:08:58 +0000 (08:08 +0000)
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>
src/runtime/netpoll_kqueue.go

index 54586a393d65b0b649b7c9d55bf318fb7a7c2b27..22902aa7869c37212c84671db511685074bfcf4e 100644 (file)
@@ -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)