X-Git-Url: http://git.archive.openwrt.org/?a=blobdiff_plain;f=uloop.c;h=c3d206a0ed146a5d12173543d9af37acb166811e;hb=f32a53f92b377fa92dbafd2ce3d2df93fffb314d;hp=0566d80e181fe18ec2fd0780bb5f0f9938261d39;hpb=13a9b7c709ed78ec10a3fec2b631c2c3cfa2792f;p=project%2Flibubox.git diff --git a/uloop.c b/uloop.c index 0566d80..c3d206a 100644 --- a/uloop.c +++ b/uloop.c @@ -174,7 +174,8 @@ static int uloop_fetch_events(int timeout) if (events[n].flags & EV_ERROR) { u->error = true; - uloop_fd_delete(u); + if (!(u->flags & ULOOP_ERROR_CB)) + uloop_fd_delete(u); } if(events[n].filter == EVFILT_READ) @@ -268,7 +269,8 @@ static int uloop_fetch_events(int timeout) if (events[n].events & (EPOLLERR|EPOLLHUP)) { u->error = true; - uloop_fd_delete(u); + if (!(u->flags & ULOOP_ERROR_CB)) + uloop_fd_delete(u); } if(!(events[n].events & (EPOLLRDHUP|EPOLLIN|EPOLLOUT|EPOLLERR|EPOLLHUP))) { @@ -383,6 +385,7 @@ int uloop_fd_add(struct uloop_fd *sock, unsigned int flags) sock->registered = true; sock->eof = false; + sock->error = false; out: return ret; @@ -643,6 +646,7 @@ void uloop_run(void) if (!recursive_calls++) uloop_setup_signals(true); + uloop_cancelled = false; while(!uloop_cancelled) { uloop_gettime(&tv);