diff options
author | Ivan Zhakov <ivan@apache.org> | 2022-11-20 07:14:38 +0000 |
---|---|---|
committer | Ivan Zhakov <ivan@apache.org> | 2022-11-20 07:14:38 +0000 |
commit | 4f9b76b6f2acc4030ce9ef164322514c5d0e761b (patch) | |
tree | 9b993b3753affcbf164056826f9d568d8760b3a1 /poll | |
parent | 961caf5f46055483fa72ab02f5e8baa16c209e2f (diff) | |
download | apr-4f9b76b6f2acc4030ce9ef164322514c5d0e761b.tar.gz |
Remove trailing whitespaces in *.c.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1905414 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poll')
-rw-r--r-- | poll/unix/epoll.c | 26 | ||||
-rw-r--r-- | poll/unix/kqueue.c | 36 | ||||
-rw-r--r-- | poll/unix/poll.c | 10 | ||||
-rw-r--r-- | poll/unix/port.c | 22 | ||||
-rw-r--r-- | poll/unix/select.c | 2 | ||||
-rw-r--r-- | poll/unix/z_asio.c | 14 |
6 files changed, 55 insertions, 55 deletions
diff --git a/poll/unix/epoll.c b/poll/unix/epoll.c index 485747732..77caa6767 100644 --- a/poll/unix/epoll.c +++ b/poll/unix/epoll.c @@ -239,7 +239,7 @@ static apr_status_t impl_pollset_remove(apr_pollset_t *pollset, ep != APR_RING_SENTINEL(&(pollset->p->query_ring), pfd_elem_t, link); ep = APR_RING_NEXT(ep, link)) { - + if (descriptor->desc.s == ep->pfd.desc.s) { APR_RING_REMOVE(ep, link); APR_RING_INSERT_TAIL(&(pollset->p->dead_ring), @@ -347,13 +347,13 @@ static apr_status_t impl_pollcb_create(apr_pollcb_t *pollcb, apr_uint32_t flags) { int fd; - + #ifdef HAVE_EPOLL_CREATE1 fd = epoll_create1(EPOLL_CLOEXEC); #else fd = epoll_create(size); #endif - + if (fd < 0) { return apr_get_netos_error(); } @@ -379,7 +379,7 @@ static apr_status_t impl_pollcb_create(apr_pollcb_t *pollcb, } } #endif - + pollcb->fd = fd; pollcb->pollset.epoll = apr_palloc(p, size * sizeof(struct epoll_event)); @@ -391,7 +391,7 @@ static apr_status_t impl_pollcb_add(apr_pollcb_t *pollcb, { struct epoll_event ev = { 0 }; int ret; - + ev.events = get_epoll_event(descriptor->reqevents); ev.data.ptr = (void *) descriptor; @@ -403,11 +403,11 @@ static apr_status_t impl_pollcb_add(apr_pollcb_t *pollcb, ret = epoll_ctl(pollcb->fd, EPOLL_CTL_ADD, descriptor->desc.f->filedes, &ev); } - + if (ret == -1) { return apr_get_netos_error(); } - + return APR_SUCCESS; } @@ -419,7 +419,7 @@ static apr_status_t impl_pollcb_remove(apr_pollcb_t *pollcb, * kernel < 2.6.9 */ int ret; - + if (descriptor->desc_type == APR_POLL_SOCKET) { ret = epoll_ctl(pollcb->fd, EPOLL_CTL_DEL, descriptor->desc.s->socketdes, &ev); @@ -428,11 +428,11 @@ static apr_status_t impl_pollcb_remove(apr_pollcb_t *pollcb, ret = epoll_ctl(pollcb->fd, EPOLL_CTL_DEL, descriptor->desc.f->filedes, &ev); } - + if (ret < 0) { rv = APR_NOTFOUND; } - + return rv; } @@ -444,11 +444,11 @@ static apr_status_t impl_pollcb_poll(apr_pollcb_t *pollcb, { int ret, i; apr_status_t rv = APR_SUCCESS; - + if (timeout > 0) { timeout = (timeout + 999) / 1000; } - + ret = epoll_wait(pollcb->fd, pollcb->pollset.epoll, pollcb->nalloc, timeout); if (ret < 0) { @@ -476,7 +476,7 @@ static apr_status_t impl_pollcb_poll(apr_pollcb_t *pollcb, } } } - + return rv; } diff --git a/poll/unix/kqueue.c b/poll/unix/kqueue.c index 7fbfbb882..2d904a2a2 100644 --- a/poll/unix/kqueue.c +++ b/poll/unix/kqueue.c @@ -368,7 +368,7 @@ static apr_status_t impl_pollcb_create(apr_pollcb_t *pollcb, apr_uint32_t flags) { int fd; - + fd = kqueue(); if (fd < 0) { return apr_get_netos_error(); @@ -393,10 +393,10 @@ static apr_status_t impl_pollcb_create(apr_pollcb_t *pollcb, return rv; } } - + pollcb->fd = fd; pollcb->pollset.ke = (struct kevent *) apr_pcalloc(p, 2 * size * sizeof(struct kevent)); - + return APR_SUCCESS; } @@ -406,30 +406,30 @@ static apr_status_t impl_pollcb_add(apr_pollcb_t *pollcb, apr_os_sock_t fd; struct kevent ev; apr_status_t rv = APR_SUCCESS; - + if (descriptor->desc_type == APR_POLL_SOCKET) { fd = descriptor->desc.s->socketdes; } else { fd = descriptor->desc.f->filedes; } - + if (descriptor->reqevents & APR_POLLIN) { EV_SET(&ev, fd, EVFILT_READ, EV_ADD, 0, 0, descriptor); - + if (kevent(pollcb->fd, &ev, 1, NULL, 0, NULL) == -1) { rv = apr_get_netos_error(); } } - + if (descriptor->reqevents & APR_POLLOUT && rv == APR_SUCCESS) { EV_SET(&ev, fd, EVFILT_WRITE, EV_ADD, 0, 0, descriptor); - + if (kevent(pollcb->fd, &ev, 1, NULL, 0, NULL) == -1) { rv = apr_get_netos_error(); } } - + return rv; } @@ -439,7 +439,7 @@ static apr_status_t impl_pollcb_remove(apr_pollcb_t *pollcb, apr_status_t rv; struct kevent ev; apr_os_sock_t fd; - + if (descriptor->desc_type == APR_POLL_SOCKET) { fd = descriptor->desc.s->socketdes; } @@ -450,20 +450,20 @@ static apr_status_t impl_pollcb_remove(apr_pollcb_t *pollcb, rv = APR_NOTFOUND; /* unless at least one of the specified conditions is */ if (descriptor->reqevents & APR_POLLIN) { EV_SET(&ev, fd, EVFILT_READ, EV_DELETE, 0, 0, NULL); - + if (kevent(pollcb->fd, &ev, 1, NULL, 0, NULL) != -1) { rv = APR_SUCCESS; } } - + if (descriptor->reqevents & APR_POLLOUT) { EV_SET(&ev, fd, EVFILT_WRITE, EV_DELETE, 0, 0, NULL); - + if (kevent(pollcb->fd, &ev, 1, NULL, 0, NULL) != -1) { rv = APR_SUCCESS; } } - + return rv; } @@ -476,7 +476,7 @@ static apr_status_t impl_pollcb_poll(apr_pollcb_t *pollcb, int ret, i; struct timespec tv, *tvptr; apr_status_t rv = APR_SUCCESS; - + if (timeout < 0) { tvptr = NULL; } @@ -485,7 +485,7 @@ static apr_status_t impl_pollcb_poll(apr_pollcb_t *pollcb, tv.tv_nsec = (long) apr_time_usec(timeout) * 1000; tvptr = &tv; } - + ret = kevent(pollcb->fd, NULL, 0, pollcb->pollset.ke, 2 * pollcb->nalloc, tvptr); @@ -508,9 +508,9 @@ static apr_status_t impl_pollcb_poll(apr_pollcb_t *pollcb, pollfd->rtnevents = get_kqueue_revent(pollcb->pollset.ke[i].filter, pollcb->pollset.ke[i].flags); - + rv = func(baton, pollfd); - + if (rv) { return rv; } diff --git a/poll/unix/poll.c b/poll/unix/poll.c index c33157296..de55f3022 100644 --- a/poll/unix/poll.c +++ b/poll/unix/poll.c @@ -69,7 +69,7 @@ static apr_int16_t get_revent(apr_int16_t event) #define SMALL_POLLSET_LIMIT 8 APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, apr_int32_t num, - apr_int32_t *nsds, + apr_int32_t *nsds, apr_interval_time_t timeout) { int i, num_to_poll; @@ -129,7 +129,7 @@ APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, apr_int32_t num, aprset[i].rtnevents = get_revent(pollset[i].revents); } } - + #if !defined(HAVE_VLA) && !defined(HAVE_ALLOCA) if (num > SMALL_POLLSET_LIMIT) { free(pollset); @@ -160,7 +160,7 @@ static apr_status_t impl_pollset_create(apr_pollset_t *pollset, apr_pool_t *p, apr_uint32_t flags) { - if (flags & APR_POLLSET_THREADSAFE) { + if (flags & APR_POLLSET_THREADSAFE) { return APR_ENOTIMPL; } @@ -355,7 +355,7 @@ static apr_status_t impl_pollcb_add(apr_pollcb_t *pollcb, get_event(descriptor->reqevents); pollcb->copyset[pollcb->nelts] = descriptor; pollcb->nelts++; - + return APR_SUCCESS; } @@ -442,7 +442,7 @@ static apr_status_t impl_pollcb_poll(apr_pollcb_t *pollcb, return APR_EINTR; } #endif - pollfd->rtnevents = get_revent(pollcb->pollset.ps[i].revents); + pollfd->rtnevents = get_revent(pollcb->pollset.ps[i].revents); rv = func(baton, pollfd); if (rv) { return rv; diff --git a/poll/unix/port.c b/poll/unix/port.c index 638a8cba7..b3c6e2fbd 100644 --- a/poll/unix/port.c +++ b/poll/unix/port.c @@ -86,7 +86,7 @@ struct apr_pollset_private_t volatile apr_uint32_t waiting; }; -static apr_status_t call_port_getn(int port, port_event_t list[], +static apr_status_t call_port_getn(int port, port_event_t list[], unsigned int max, unsigned int *nget, apr_interval_time_t timeout) { @@ -108,7 +108,7 @@ static apr_status_t call_port_getn(int port, port_event_t list[], */ ret = port_getn(port, list, max, nget, tvptr); - /* Note: 32-bit port_getn() on Solaris 10 x86 returns large negative + /* Note: 32-bit port_getn() on Solaris 10 x86 returns large negative * values instead of 0 when returning immediately. */ @@ -246,7 +246,7 @@ static apr_status_t impl_pollset_add(apr_pollset_t *pollset, * wait until the next call to apr_pollset_poll(). */ if (apr_atomic_read32(&pollset->p->waiting)) { - res = port_associate(pollset->p->port_fd, PORT_SOURCE_FD, fd, + res = port_associate(pollset->p->port_fd, PORT_SOURCE_FD, fd, get_event(descriptor->reqevents), (void *)elem); if (res < 0) { @@ -257,7 +257,7 @@ static apr_status_t impl_pollset_add(apr_pollset_t *pollset, elem->on_query_ring = 1; APR_RING_INSERT_TAIL(&(pollset->p->query_ring), elem, pfd_elem_t, link); } - } + } else { APR_RING_INSERT_TAIL(&(pollset->p->add_ring), elem, pfd_elem_t, link); } @@ -287,10 +287,10 @@ static apr_status_t impl_pollset_remove(apr_pollset_t *pollset, } /* Search the add ring first. This ring is often shorter, - * and it often contains the descriptor being removed. - * (For the common scenario where apr_pollset_poll() + * and it often contains the descriptor being removed. + * (For the common scenario where apr_pollset_poll() * returns activity for the descriptor and the descriptor - * is then removed from the pollset, it will have just + * is then removed from the pollset, it will have just * been moved to the add ring by apr_pollset_poll().) * * If it is on the add ring, it isn't associated with the @@ -317,7 +317,7 @@ static apr_status_t impl_pollset_remove(apr_pollset_t *pollset, if (res < 0) { /* The expected case for this failure is that another * thread's call to port_getn() returned this fd and - * disassociated the fd from the event port, and + * disassociated the fd from the event port, and * impl_pollset_poll() is blocked on the ring lock, * which this thread holds. */ @@ -378,7 +378,7 @@ static apr_status_t impl_pollset_poll(apr_pollset_t *pollset, fd = ep->pfd.desc.f->filedes; } - ret = port_associate(pollset->p->port_fd, PORT_SOURCE_FD, + ret = port_associate(pollset->p->port_fd, PORT_SOURCE_FD, fd, get_event(ep->pfd.reqevents), ep); if (ret < 0) { rv = apr_get_netos_error(); @@ -397,10 +397,10 @@ static apr_status_t impl_pollset_poll(apr_pollset_t *pollset, return rv; } - rv = call_port_getn(pollset->p->port_fd, pollset->p->port_set, + rv = call_port_getn(pollset->p->port_fd, pollset->p->port_set, pollset->nalloc, &nget, timeout); - /* decrease the waiting ASAP to reduce the window for calling + /* decrease the waiting ASAP to reduce the window for calling port_associate within apr_pollset_add() */ apr_atomic_dec32(&pollset->p->waiting); diff --git a/poll/unix/select.c b/poll/unix/select.c index 562ced7f6..70df4126e 100644 --- a/poll/unix/select.c +++ b/poll/unix/select.c @@ -199,7 +199,7 @@ static apr_status_t impl_pollset_create(apr_pollset_t *pollset, apr_pool_t *p, apr_uint32_t flags) { - if (flags & APR_POLLSET_THREADSAFE) { + if (flags & APR_POLLSET_THREADSAFE) { pollset->p = NULL; return APR_ENOTIMPL; } diff --git a/poll/unix/z_asio.c b/poll/unix/z_asio.c index e7d9d9da3..0181dd384 100644 --- a/poll/unix/z_asio.c +++ b/poll/unix/z_asio.c @@ -247,7 +247,7 @@ static apr_status_t asio_pollset_cleanup(apr_pollset_t *pollset) int rv; DBG(4, "entered\n"); - if (pollset->flags & APR_POLLSET_THREADSAFE) { + if (pollset->flags & APR_POLLSET_THREADSAFE) { rv = msgctl(pollset->p->msg_q, IPC_RMID, NULL); DBG1(4, "asio_pollset_cleanup: msgctl(IPC_RMID) returned %d\n", rv); } @@ -484,7 +484,7 @@ static apr_status_t asio_pollset_remove(apr_pollset_t *pollset, apr_status_t rv = APR_SUCCESS; apr_pollset_private_t *priv = pollset->p; /* AIO_CANCEL is synchronous, so autodata works fine. */ - struct aiocb cancel_a = {0}; + struct aiocb cancel_a = {0}; int fd; @@ -519,7 +519,7 @@ static apr_status_t asio_pollset_remove(apr_pollset_t *pollset, cancel_a.aio_cflags = 0; cancel_a.aio_cflags2 = 0; - /* we want the original aiocb to show up on the pollset message queue + /* we want the original aiocb to show up on the pollset message queue * before recycling its memory to eliminate race conditions */ @@ -650,12 +650,12 @@ static apr_status_t asio_pollset_poll(apr_pollset_t *pollset, if (elem->state == ASIO_REMOVED) { - /* + /* * async i/o is done since it was found on prior_ready - * the state says the caller is done with it too - * so recycle the elem + * the state says the caller is done with it too + * so recycle the elem */ - + APR_RING_INSERT_TAIL(&(priv->free_ring), elem, asio_elem_t, link); continue; /* do not re-add if it has been _removed */ |