summaryrefslogtreecommitdiff
path: root/poll/unix/kqueue.c
diff options
context:
space:
mode:
authorivan <ivan@13f79535-47bb-0310-9956-ffa450edef68>2022-11-20 07:14:38 +0000
committerivan <ivan@13f79535-47bb-0310-9956-ffa450edef68>2022-11-20 07:14:38 +0000
commita1f2631420b9981cc3acc663801d6bebd7315a4f (patch)
tree9b993b3753affcbf164056826f9d568d8760b3a1 /poll/unix/kqueue.c
parent07aae469da822d77cd229a647dedc4701749b1ff (diff)
downloadlibapr-a1f2631420b9981cc3acc663801d6bebd7315a4f.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/unix/kqueue.c')
-rw-r--r--poll/unix/kqueue.c36
1 files changed, 18 insertions, 18 deletions
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;
}