mirror of
https://github.com/amnezia-vpn/amneziawg-go.git
synced 2025-07-28 16:02:50 +02:00
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>
This commit is contained in:
parent
8051f17147
commit
2cad62c40b
1 changed files with 1 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue