Skip to content

Commit 436f7fd

Browse files
win-tzx2c4
authored andcommitted
rwcancel: fix wrong poll event flag on ReadyWrite
It should be POLLIN because closeFd is read-only file. Signed-off-by: Kurnia D Win <[email protected]> Signed-off-by: Jason A. Donenfeld <[email protected]>
1 parent 0e4482a commit 436f7fd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

rwcancel/rwcancel.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ func (rw *RWCancel) ReadyRead() bool {
6464

6565
func (rw *RWCancel) ReadyWrite() bool {
6666
closeFd := int32(rw.closingReader.Fd())
67-
pollFds := []unix.PollFd{{Fd: int32(rw.fd), Events: unix.POLLOUT}, {Fd: closeFd, Events: unix.POLLOUT}}
67+
pollFds := []unix.PollFd{{Fd: int32(rw.fd), Events: unix.POLLOUT}, {Fd: closeFd, Events: unix.POLLIN}}
6868
var err error
6969
for {
7070
_, err = unix.Poll(pollFds, -1)

0 commit comments

Comments
 (0)