handle errors signalled by epoll

master
leitner 21 years ago
parent 0335358787
commit 96be549818

@ -27,6 +27,11 @@ int64 io_waituntil2(int64 milliseconds) {
for (i=n-1; i>=0; --i) {
io_entry* e=array_get(&io_fds,sizeof(io_entry),y[i].data.fd);
if (e) {
if (y[i].events&(EPOLLERR|EPOLLHUP)) {
/* error; signal whatever app is looking for */
if (e->wantread) y[i].events|=EPOLLIN;
if (e->wantwrite) y[i].events|=EPOLLOUT;
}
if (!e->canread && (y[i].events&EPOLLIN)) {
e->canread=1;
e->next_read=first_readable;

Loading…
Cancel
Save