… | |
… | |
77 | |
77 | |
78 | static void |
78 | static void |
79 | poll_poll (EV_P_ ev_tstamp timeout) |
79 | poll_poll (EV_P_ ev_tstamp timeout) |
80 | { |
80 | { |
81 | int i; |
81 | int i; |
82 | int res = poll (polls, pollcnt, ceil (timeout * 1000.)); |
82 | int res = poll (polls, pollcnt, (int)ceil (timeout * 1000.)); |
83 | |
83 | |
84 | if (res < 0) |
84 | if (res < 0) |
85 | { |
85 | { |
86 | if (errno == EBADF) |
86 | if (errno == EBADF) |
87 | fd_ebadf (EV_A); |
87 | fd_ebadf (EV_A); |
… | |
… | |
92 | |
92 | |
93 | return; |
93 | return; |
94 | } |
94 | } |
95 | |
95 | |
96 | for (i = 0; i < pollcnt; ++i) |
96 | for (i = 0; i < pollcnt; ++i) |
|
|
97 | if (polls [i].revents & POLLNVAL) |
|
|
98 | fd_kill (EV_A_ polls [i].fd); |
|
|
99 | else |
97 | fd_event ( |
100 | fd_event ( |
98 | EV_A_ |
101 | EV_A_ |
99 | polls [i].fd, |
102 | polls [i].fd, |
100 | (polls [i].revents & (POLLOUT | POLLERR | POLLHUP) ? EV_WRITE : 0) |
103 | (polls [i].revents & (POLLOUT | POLLERR | POLLHUP) ? EV_WRITE : 0) |
101 | | (polls [i].revents & (POLLIN | POLLERR | POLLHUP) ? EV_READ : 0) |
104 | | (polls [i].revents & (POLLIN | POLLERR | POLLHUP) ? EV_READ : 0) |
102 | ); |
105 | ); |
103 | } |
106 | } |
104 | |
107 | |
105 | static int |
108 | static int |
106 | poll_init (EV_P_ int flags) |
109 | poll_init (EV_P_ int flags) |
107 | { |
110 | { |