diff options
author | 2023-06-07 12:41:02 +0700 | |
---|---|---|
committer | 2025-05-05 15:10:08 +0200 | |
commit | 436f7fdc1670df26eee958de464cf5cb0385abec (patch) | |
tree | 6d23eafd21fed9f53a4083813660fc8cac04d3d4 | |
parent | device: use rand.NewSource instead of rand.Seed (diff) | |
download | wireguard-go-436f7fdc1670df26eee958de464cf5cb0385abec.tar.xz wireguard-go-436f7fdc1670df26eee958de464cf5cb0385abec.zip |
rwcancel: fix wrong poll event flag on ReadyWrite
It should be POLLIN because closeFd is read-only file.
Signed-off-by: Kurnia D Win <kurnia.d.win@gmail.com>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
-rw-r--r-- | rwcancel/rwcancel.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/rwcancel/rwcancel.go b/rwcancel/rwcancel.go index 793e764..4372453 100644 --- a/rwcancel/rwcancel.go +++ b/rwcancel/rwcancel.go @@ -64,7 +64,7 @@ func (rw *RWCancel) ReadyRead() bool { func (rw *RWCancel) ReadyWrite() bool { closeFd := int32(rw.closingReader.Fd()) - pollFds := []unix.PollFd{{Fd: int32(rw.fd), Events: unix.POLLOUT}, {Fd: closeFd, Events: unix.POLLOUT}} + pollFds := []unix.PollFd{{Fd: int32(rw.fd), Events: unix.POLLOUT}, {Fd: closeFd, Events: unix.POLLIN}} var err error for { _, err = unix.Poll(pollFds, -1) |