Skip to content

Commit 0c77b57

Browse files
Report EPOLLERR as is_write_closed (#1350)
The epoll_ctl(2) manual says to following about EPOLLERR Error condition happened on the associated file descriptor. This event is also reported for the write end of a pipe when the read end has been closed. In practice we've seen a number of event variations when the read side of a Unix pipe(2) is closed, including EPOLLHUP and EPOLLOUT|EPOLLERR. And now we've also seen just EPOLLERR, without EPOLLOUT. This caused the process_issue_2174 test to fail in Tokio, currently found here: https://github.com/tokio-rs/tokio/blob/078d0a2ebc4d4f88cb6bce05c8ac4f5038dae9be/tokio/tests/process_issue_2174.rs.
1 parent d555991 commit 0c77b57

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/sys/unix/selector/epoll.rs

+2
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,8 @@ pub mod event {
172172
// Unix pipe write end has closed
173173
|| (event.events as libc::c_int & libc::EPOLLOUT != 0
174174
&& event.events as libc::c_int & libc::EPOLLERR != 0)
175+
// The other side (read end) of a Unix pipe has closed.
176+
|| event.events as libc::c_int == libc::EPOLLERR
175177
}
176178

177179
pub fn is_priority(event: &Event) -> bool {

0 commit comments

Comments
 (0)