]> Cypherpunks repositories - gostls13.git/commit
internal/poll, runtime: handle netpollopen error in poll_runtime_pollOpen
authorTobias Klauser <tklauser@distanz.ch>
Mon, 1 Mar 2021 18:55:22 +0000 (19:55 +0100)
committerTobias Klauser <tobias.klauser@gmail.com>
Tue, 2 Mar 2021 06:08:56 +0000 (06:08 +0000)
commitebb92dfed96fadb3c563ff11cead85bbb7536793
treeeed2b4258619c50f85431ba5f93a08d31b7346e8
parent4c1a7ab49c4c68907bc7f7f7f776edd9116584a5
internal/poll, runtime: handle netpollopen error in poll_runtime_pollOpen

When netpollopen in poll_runtime_pollOpen returns an error, the work in
runtime_pollUnblock and runtime_pollClose can be avoided since the
underlying system call to set up the poller failed.

E.g. on linux, this avoids calling netpollclose and thus epoll_ctl(fd,
EPOLL_CTL_DEL, ...) in case the file does not support epoll, i.e.
epoll_ctl(fd, EPOLL_CTL_ADD, ...) in netpollopen failed.

Fixes #44552

Change-Id: I564d90340fd1ab3a6490526353616a447ae0cfb8
Reviewed-on: https://go-review.googlesource.com/c/go/+/297392
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/internal/poll/fd_poll_runtime.go
src/runtime/netpoll.go