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

Comparing libev/ev_port.c (file contents):
Revision 1.11 by root, Fri May 23 16:37:38 2008 UTC vs.
Revision 1.15 by root, Fri Jul 10 00:36:21 2009 UTC

57 ) 57 )
58 { 58 {
59 if (errno == EBADFD) 59 if (errno == EBADFD)
60 fd_kill (EV_A_ fd); 60 fd_kill (EV_A_ fd);
61 else 61 else
62 syserr ("(libev) port_associate"); 62 ev_syserr ("(libev) port_associate");
63 } 63 }
64} 64}
65 65
66static void 66static void
67port_modify (EV_P_ int fd, int oev, int nev) 67port_modify (EV_P_ int fd, int oev, int nev)
83{ 83{
84 int res, i; 84 int res, i;
85 struct timespec ts; 85 struct timespec ts;
86 uint_t nget = 1; 86 uint_t nget = 1;
87 87
88 EV_SUSPEND_CB;
88 ts.tv_sec = (time_t)timeout; 89 ts.tv_sec = (time_t)timeout;
89 ts.tv_nsec = (long)(timeout - (ev_tstamp)ts.tv_sec) * 1e9; 90 ts.tv_nsec = (long)(timeout - (ev_tstamp)ts.tv_sec) * 1e9;
90 res = port_getn (backend_fd, port_events, port_eventmax, &nget, &ts); 91 res = port_getn (backend_fd, port_events, port_eventmax, &nget, &ts);
92 EV_RESUME_CB;
91 93
92 if (res < 0) 94 if (res == -1)
93 { 95 {
94 if (errno != EINTR && errno != ETIME) 96 if (errno != EINTR && errno != ETIME)
95 syserr ("(libev) port_getn"); 97 ev_syserr ("(libev) port_getn");
96 98
97 return; 99 return;
98 } 100 }
99 101
100 for (i = 0; i < nget; ++i) 102 for (i = 0; i < nget; ++i)
151port_fork (EV_P) 153port_fork (EV_P)
152{ 154{
153 close (backend_fd); 155 close (backend_fd);
154 156
155 while ((backend_fd = port_create ()) < 0) 157 while ((backend_fd = port_create ()) < 0)
156 syserr ("(libev) port"); 158 ev_syserr ("(libev) port");
157 159
158 fcntl (backend_fd, F_SETFD, FD_CLOEXEC); 160 fcntl (backend_fd, F_SETFD, FD_CLOEXEC);
159 161
160 /* re-register interest in fds */ 162 /* re-register interest in fds */
161 fd_rearm_all (EV_A); 163 fd_rearm_all (EV_A);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines