handle errors signalled by epoll

This commit is contained in:
Felix von Leitner 2003-11-01 04:44:33 +00:00
parent 73f198b17d
commit e0e709bfa9
1 changed files with 5 additions and 0 deletions

View File

@ -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;