aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKurnia D Win <kurnia.d.win@gmail.com>2023-06-07 12:41:02 +0700
committerJason A. Donenfeld <Jason@zx2c4.com>2025-05-05 15:10:08 +0200
commit436f7fdc1670df26eee958de464cf5cb0385abec (patch)
tree6d23eafd21fed9f53a4083813660fc8cac04d3d4
parentdevice: use rand.NewSource instead of rand.Seed (diff)
downloadwireguard-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.go2
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)