diff options
author | michael <michael@82007160-df01-0410-b94d-b575c5fd34c7> | 2013-12-10 19:46:34 +0000 |
---|---|---|
committer | michael <michael@82007160-df01-0410-b94d-b575c5fd34c7> | 2013-12-10 19:46:34 +0000 |
commit | f2eb28bc31da833feed1c35e0dc4c87b2b32dc3c (patch) | |
tree | 5555a489f69d75fc141b896e3a2ebb2a8770d6b3 | |
parent | 0efb6adec538b6112b3e2ce782cc84001fb6ecd0 (diff) |
- s_bsd_select.c, s_bsd_devpoll.c, s_bsd_epoll.c,
s_bsd_kqueue.c, s_bsd_poll.c: style corrections
git-svn-id: svn://svn.ircd-hybrid.org/svnroot/ircd-hybrid/branches/8.1.x@2649 82007160-df01-0410-b94d-b575c5fd34c7
-rw-r--r-- | src/s_bsd_devpoll.c | 4 | ||||
-rw-r--r-- | src/s_bsd_epoll.c | 12 | ||||
-rw-r--r-- | src/s_bsd_kqueue.c | 6 | ||||
-rw-r--r-- | src/s_bsd_poll.c | 23 | ||||
-rw-r--r-- | src/s_bsd_select.c | 10 |
5 files changed, 39 insertions, 16 deletions
diff --git a/src/s_bsd_devpoll.c b/src/s_bsd_devpoll.c index 49d4eee..4bc5aaa 100644 --- a/src/s_bsd_devpoll.c +++ b/src/s_bsd_devpoll.c @@ -163,6 +163,7 @@ comm_select(void) continue; if ((dopoll.dp_fds[i].revents & POLLIN)) + { if ((hdl = F->read_handler) != NULL) { F->read_handler = NULL; @@ -170,8 +171,10 @@ comm_select(void) if (!F->flags.open) continue; } + } if ((dopoll.dp_fds[i].revents & POLLOUT)) + { if ((hdl = F->write_handler) != NULL) { F->write_handler = NULL; @@ -179,6 +182,7 @@ comm_select(void) if (!F->flags.open) continue; } + } comm_setselect(F, 0, NULL, NULL, 0); } diff --git a/src/s_bsd_epoll.c b/src/s_bsd_epoll.c index 8e8de83..088a3ff 100644 --- a/src/s_bsd_epoll.c +++ b/src/s_bsd_epoll.c @@ -198,22 +198,26 @@ comm_select(void) continue; if ((ep_fdlist[i].events & (EPOLLIN | EPOLLHUP | EPOLLERR))) + { if ((hdl = F->read_handler) != NULL) { F->read_handler = NULL; hdl(F, F->read_data); - if (!F->flags.open) - continue; + if (!F->flags.open) + continue; } + } if ((ep_fdlist[i].events & (EPOLLOUT | EPOLLHUP | EPOLLERR))) + { if ((hdl = F->write_handler) != NULL) { F->write_handler = NULL; hdl(F, F->write_data); - if (!F->flags.open) - continue; + if (!F->flags.open) + continue; } + } comm_setselect(F, 0, NULL, NULL, 0); } diff --git a/src/s_bsd_kqueue.c b/src/s_bsd_kqueue.c index 94e1777..cb38e50 100644 --- a/src/s_bsd_kqueue.c +++ b/src/s_bsd_kqueue.c @@ -117,7 +117,7 @@ comm_setselect(fde_t *F, unsigned int type, PF *handler, } new_events = (F->read_handler ? COMM_SELECT_READ : 0) | - (F->write_handler ? COMM_SELECT_WRITE : 0); + (F->write_handler ? COMM_SELECT_WRITE : 0); if (timeout != 0) F->timeout = CurrentTime + (timeout / 1000); @@ -178,6 +178,7 @@ comm_select(void) continue; if (ke[i].filter == EVFILT_READ) + { if ((hdl = F->read_handler) != NULL) { F->read_handler = NULL; @@ -185,8 +186,10 @@ comm_select(void) if (!F->flags.open) continue; } + } if (ke[i].filter == EVFILT_WRITE) + { if ((hdl = F->write_handler) != NULL) { F->write_handler = NULL; @@ -194,6 +197,7 @@ comm_select(void) if (!F->flags.open) continue; } + } comm_setselect(F, 0, NULL, NULL, 0); } diff --git a/src/s_bsd_poll.c b/src/s_bsd_poll.c index 2bcd214..fbbc5c0 100644 --- a/src/s_bsd_poll.c +++ b/src/s_bsd_poll.c @@ -109,7 +109,7 @@ comm_setselect(fde_t *F, unsigned int type, PF *handler, } new_events = (F->read_handler ? POLLRDNORM : 0) | - (F->write_handler ? POLLWRNORM : 0); + (F->write_handler ? POLLWRNORM : 0); if (timeout != 0) F->timeout = CurrentTime + (timeout / 1000); @@ -123,18 +123,19 @@ comm_setselect(fde_t *F, unsigned int type, PF *handler, if (pollmax == F->comm_index) while (pollmax >= 0 && pollfds[pollmax].fd == -1) - pollmax--; + pollmax--; } else { if (F->evcache == 0) { F->comm_index = poll_findslot(); - if (F->comm_index > pollmax) - pollmax = F->comm_index; + if (F->comm_index > pollmax) + pollmax = F->comm_index; - pollfds[F->comm_index].fd = F->fd; + pollfds[F->comm_index].fd = F->fd; } + pollfds[F->comm_index].events = new_events; pollfds[F->comm_index].revents = 0; } @@ -182,22 +183,26 @@ comm_select(void) continue; if (revents & (POLLRDNORM | POLLIN | POLLHUP | POLLERR)) + { if ((hdl = F->read_handler) != NULL) { F->read_handler = NULL; hdl(F, F->read_data); - if (!F->flags.open) - continue; + if (!F->flags.open) + continue; } + } if (revents & (POLLWRNORM | POLLOUT | POLLHUP | POLLERR)) + { if ((hdl = F->write_handler) != NULL) { F->write_handler = NULL; hdl(F, F->write_data); - if (!F->flags.open) - continue; + if (!F->flags.open) + continue; } + } comm_setselect(F, 0, NULL, NULL, 0); } diff --git a/src/s_bsd_select.c b/src/s_bsd_select.c index d94883a..464cdfe 100644 --- a/src/s_bsd_select.c +++ b/src/s_bsd_select.c @@ -81,7 +81,7 @@ comm_setselect(fde_t *F, unsigned int type, PF *handler, } new_events = (F->read_handler ? COMM_SELECT_READ : 0) | - (F->write_handler ? COMM_SELECT_WRITE : 0); + (F->write_handler ? COMM_SELECT_WRITE : 0); if (timeout != 0) F->timeout = CurrentTime + (timeout / 1000); @@ -108,7 +108,7 @@ comm_setselect(fde_t *F, unsigned int type, PF *handler, { if (highest_fd == F->fd) while (highest_fd >= 0 && (FD_ISSET(highest_fd, &select_readfds) || - FD_ISSET(highest_fd, &select_writefds))) + FD_ISSET(highest_fd, &select_writefds))) highest_fd--; } else if (F->evcache == 0) @@ -154,6 +154,7 @@ comm_select(void) } for (fd = 0; fd <= highest_fd && num > 0; fd++) + { if (FD_ISSET(fd, &tmpreadfds) || FD_ISSET(fd, &tmpwritefds)) { num--; @@ -163,6 +164,7 @@ comm_select(void) continue; if (FD_ISSET(fd, &tmpreadfds)) + { if ((hdl = F->read_handler) != NULL) { F->read_handler = NULL; @@ -170,8 +172,10 @@ comm_select(void) if (!F->flags.open) continue; } + } if (FD_ISSET(fd, &tmpwritefds)) + { if ((hdl = F->write_handler) != NULL) { F->write_handler = NULL; @@ -179,8 +183,10 @@ comm_select(void) if (!F->flags.open) continue; } + } comm_setselect(F, 0, NULL, NULL, 0); } + } } #endif |