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

Comparing libev/ev_poll.c (file contents):
Revision 1.43 by root, Wed Jun 26 00:01:46 2019 UTC vs.
Revision 1.44 by root, Mon Jul 1 20:47:38 2019 UTC

78 | (nev & EV_WRITE ? POLLOUT : 0); 78 | (nev & EV_WRITE ? POLLOUT : 0);
79 else /* remove pollfd */ 79 else /* remove pollfd */
80 { 80 {
81 pollidxs [fd] = -1; 81 pollidxs [fd] = -1;
82 82
83 if (expect_true (idx < --pollcnt)) 83 if (ecb_expect_true (idx < --pollcnt))
84 { 84 {
85 polls [idx] = polls [pollcnt]; 85 polls [idx] = polls [pollcnt];
86 pollidxs [polls [idx].fd] = idx; 86 pollidxs [polls [idx].fd] = idx;
87 } 87 }
88 } 88 }
96 96
97 EV_RELEASE_CB; 97 EV_RELEASE_CB;
98 res = poll (polls, pollcnt, timeout * 1e3); 98 res = poll (polls, pollcnt, timeout * 1e3);
99 EV_ACQUIRE_CB; 99 EV_ACQUIRE_CB;
100 100
101 if (expect_false (res < 0)) 101 if (ecb_expect_false (res < 0))
102 { 102 {
103 if (errno == EBADF) 103 if (errno == EBADF)
104 fd_ebadf (EV_A); 104 fd_ebadf (EV_A);
105 else if (errno == ENOMEM && !syserr_cb) 105 else if (errno == ENOMEM && !syserr_cb)
106 fd_enomem (EV_A); 106 fd_enomem (EV_A);
110 else 110 else
111 for (p = polls; res; ++p) 111 for (p = polls; res; ++p)
112 { 112 {
113 assert (("libev: poll returned illegal result, broken BSD kernel?", p < polls + pollcnt)); 113 assert (("libev: poll returned illegal result, broken BSD kernel?", p < polls + pollcnt));
114 114
115 if (expect_false (p->revents)) /* this expect is debatable */ 115 if (ecb_expect_false (p->revents)) /* this expect is debatable */
116 { 116 {
117 --res; 117 --res;
118 118
119 if (expect_false (p->revents & POLLNVAL)) 119 if (ecb_expect_false (p->revents & POLLNVAL))
120 { 120 {
121 assert (("libev: poll found invalid fd in poll set", 0)); 121 assert (("libev: poll found invalid fd in poll set", 0));
122 fd_kill (EV_A_ p->fd); 122 fd_kill (EV_A_ p->fd);
123 } 123 }
124 else 124 else

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines