Merge branch 'feat/ignore_neg_fd_poll' into 'master'
feat: ignore negative fd and clear its revents in poll(2) See merge request redox-os/relibc!484
This commit is contained in:
@@ -57,6 +57,12 @@ pub fn poll_epoll(fds: &mut [pollfd], timeout: c_int) -> c_int {
|
||||
for i in 0..fds.len() {
|
||||
let mut pfd = &mut fds[i];
|
||||
|
||||
// Ignore the entry with negative fd, set the revents to 0
|
||||
if pfd.fd < 0 {
|
||||
pfd.revents = 0;
|
||||
continue;
|
||||
}
|
||||
|
||||
let mut event = epoll_event {
|
||||
events: 0,
|
||||
data: epoll_data { u64: i as u64 },
|
||||
|
||||
Reference in New Issue
Block a user