ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libev/ev_epoll.c
(Generate patch)

Comparing libev/ev_epoll.c (file contents):
Revision 1.37 by root, Mon Oct 27 13:39:18 2008 UTC vs.
Revision 1.39 by root, Wed Oct 29 07:04:52 2008 UTC

121 int eventcnt = epoll_wait (backend_fd, epoll_events, epoll_eventmax, (int)ceil (timeout * 1000.)); 121 int eventcnt = epoll_wait (backend_fd, epoll_events, epoll_eventmax, (int)ceil (timeout * 1000.));
122 122
123 if (expect_false (eventcnt < 0)) 123 if (expect_false (eventcnt < 0))
124 { 124 {
125 if (errno != EINTR) 125 if (errno != EINTR)
126 syserr ("(libev) epoll_wait"); 126 ev_syserr ("(libev) epoll_wait");
127 127
128 return; 128 return;
129 } 129 }
130 130
131 for (i = 0; i < eventcnt; ++i) 131 for (i = 0; i < eventcnt; ++i)
136 int want = anfds [fd].events; 136 int want = anfds [fd].events;
137 int got = (ev->events & (EPOLLOUT | EPOLLERR | EPOLLHUP) ? EV_WRITE : 0) 137 int got = (ev->events & (EPOLLOUT | EPOLLERR | EPOLLHUP) ? EV_WRITE : 0)
138 | (ev->events & (EPOLLIN | EPOLLERR | EPOLLHUP) ? EV_READ : 0); 138 | (ev->events & (EPOLLIN | EPOLLERR | EPOLLHUP) ? EV_READ : 0);
139 139
140 /* check for spurious notification */ 140 /* check for spurious notification */
141 if (expect_false (anfds [fd].egen != (unsigned char)(ev->data.u64 >> 32))) 141 if (expect_false (anfds [fd].egen != (uint32_t)(ev->data.u64 >> 32)))
142 { 142 {
143 /* recreate kernel state */ 143 /* recreate kernel state */
144 postfork = 1; 144 postfork = 1;
145 continue; 145 continue;
146 } 146 }
203epoll_fork (EV_P) 203epoll_fork (EV_P)
204{ 204{
205 close (backend_fd); 205 close (backend_fd);
206 206
207 while ((backend_fd = epoll_create (256)) < 0) 207 while ((backend_fd = epoll_create (256)) < 0)
208 syserr ("(libev) epoll_create"); 208 ev_syserr ("(libev) epoll_create");
209 209
210 fcntl (backend_fd, F_SETFD, FD_CLOEXEC); 210 fcntl (backend_fd, F_SETFD, FD_CLOEXEC);
211 211
212 fd_rearm_all (EV_A); 212 fd_rearm_all (EV_A);
213} 213}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines