ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/trunk/src/s_bsd_poll.c
(Generate patch)

Comparing ircd-hybrid/trunk/src/s_bsd_poll.c (file contents):
Revision 2627 by michael, Fri Dec 6 19:39:55 2013 UTC vs.
Revision 2650 by michael, Tue Dec 10 19:46:48 2013 UTC

# Line 109 | Line 109 | comm_setselect(fde_t *F, unsigned int ty
109    }
110  
111    new_events = (F->read_handler ? POLLRDNORM : 0) |
112 <    (F->write_handler ? POLLWRNORM : 0);
112 >               (F->write_handler ? POLLWRNORM : 0);
113  
114    if (timeout != 0)
115      F->timeout = CurrentTime + (timeout / 1000);
# Line 123 | Line 123 | comm_setselect(fde_t *F, unsigned int ty
123  
124        if (pollmax == F->comm_index)
125          while (pollmax >= 0 && pollfds[pollmax].fd == -1)
126 <          pollmax--;
126 >          pollmax--;
127      }
128      else
129      {
130        if (F->evcache == 0)
131        {
132          F->comm_index = poll_findslot();
133 <        if (F->comm_index > pollmax)
134 <          pollmax = F->comm_index;
133 >        if (F->comm_index > pollmax)
134 >          pollmax = F->comm_index;
135  
136 <        pollfds[F->comm_index].fd = F->fd;
136 >        pollfds[F->comm_index].fd = F->fd;
137        }
138 +
139        pollfds[F->comm_index].events = new_events;
140        pollfds[F->comm_index].revents = 0;
141      }
# Line 182 | Line 183 | comm_select(void)
183        continue;
184  
185      if (revents & (POLLRDNORM | POLLIN | POLLHUP | POLLERR))
186 +    {
187        if ((hdl = F->read_handler) != NULL)
188        {
189          F->read_handler = NULL;
190          hdl(F, F->read_data);
191 <        if (!F->flags.open)
192 <          continue;
191 >        if (!F->flags.open)
192 >          continue;
193        }
194 +    }
195  
196      if (revents & (POLLWRNORM | POLLOUT | POLLHUP | POLLERR))
197 +    {
198        if ((hdl = F->write_handler) != NULL)
199        {
200          F->write_handler = NULL;
201          hdl(F, F->write_data);
202 <        if (!F->flags.open)
203 <          continue;
202 >        if (!F->flags.open)
203 >          continue;
204        }
205 +    }
206  
207      comm_setselect(F, 0, NULL, NULL, 0);
208    }

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)