summaryrefslogtreecommitdiff
path: root/lib/libevent
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2014-10-30 16:45:38 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2014-10-30 16:45:38 +0000
commit9c2178557b1dc2053501760cfb3d4082c3e9cc45 (patch)
treecb2264b373589cb596222864ebef83462a20a062 /lib/libevent
parent5ae04802d0f9f738f3a8173f817515060f6d14fb (diff)
Fix whitespace errors in libevent.
OK nicm@
Diffstat (limited to 'lib/libevent')
-rw-r--r--lib/libevent/buffer.c12
-rw-r--r--lib/libevent/evbuffer.c6
-rw-r--r--lib/libevent/event.c22
-rw-r--r--lib/libevent/event.h18
-rw-r--r--lib/libevent/event_tagging.c6
-rw-r--r--lib/libevent/kqueue.c30
-rw-r--r--lib/libevent/log.c20
-rw-r--r--lib/libevent/poll.c6
-rw-r--r--lib/libevent/signal.c6
9 files changed, 63 insertions, 63 deletions
diff --git a/lib/libevent/buffer.c b/lib/libevent/buffer.c
index 4b708365f8c..baa7a21da67 100644
--- a/lib/libevent/buffer.c
+++ b/lib/libevent/buffer.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: buffer.c,v 1.25 2014/10/29 22:47:29 bluhm Exp $ */
+/* $OpenBSD: buffer.c,v 1.26 2014/10/30 16:45:37 bluhm Exp $ */
/*
* Copyright (c) 2002, 2003 Niels Provos <provos@citi.umich.edu>
@@ -46,7 +46,7 @@ struct evbuffer *
evbuffer_new(void)
{
struct evbuffer *buffer;
-
+
buffer = calloc(1, sizeof(struct evbuffer));
return (buffer);
@@ -60,7 +60,7 @@ evbuffer_free(struct evbuffer *buffer)
free(buffer);
}
-/*
+/*
* This is a destructive add. The data from one buffer moves into
* the other buffer.
*/
@@ -88,7 +88,7 @@ evbuffer_add_buffer(struct evbuffer *outbuf, struct evbuffer *inbuf)
SWAP(outbuf, inbuf);
SWAP(inbuf, &tmp);
- /*
+ /*
* Optimization comes with a price; we need to notify the
* buffer if necessary of the changes. oldoff is the amount
* of data that we transferred from inbuf to outbuf
@@ -97,7 +97,7 @@ evbuffer_add_buffer(struct evbuffer *outbuf, struct evbuffer *inbuf)
(*inbuf->cb)(inbuf, oldoff, inbuf->off, inbuf->cbarg);
if (oldoff && outbuf->cb != NULL)
(*outbuf->cb)(outbuf, 0, oldoff, outbuf->cbarg);
-
+
return (0);
}
@@ -172,7 +172,7 @@ evbuffer_remove(struct evbuffer *buf, void *data, size_t datlen)
memcpy(data, buf->buffer, nread);
evbuffer_drain(buf, nread);
-
+
return (nread);
}
diff --git a/lib/libevent/evbuffer.c b/lib/libevent/evbuffer.c
index fbad9a7ba80..0a23aa17a1d 100644
--- a/lib/libevent/evbuffer.c
+++ b/lib/libevent/evbuffer.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: evbuffer.c,v 1.16 2014/10/29 22:47:29 bluhm Exp $ */
+/* $OpenBSD: evbuffer.c,v 1.17 2014/10/30 16:45:37 bluhm Exp $ */
/*
* Copyright (c) 2002-2004 Niels Provos <provos@citi.umich.edu>
@@ -56,7 +56,7 @@ bufferevent_add(struct event *ev, int timeout)
return (event_add(ev, ptv));
}
-/*
+/*
* This callback is executed when the size of the input buffer changes.
* We use it to apply back pressure on the reading side.
*/
@@ -65,7 +65,7 @@ void
bufferevent_read_pressure_cb(struct evbuffer *buf, size_t old, size_t now,
void *arg) {
struct bufferevent *bufev = arg;
- /*
+ /*
* If we are below the watermark then reschedule reading if it's
* still enabled.
*/
diff --git a/lib/libevent/event.c b/lib/libevent/event.c
index 1873d16eac6..c1aa42ebc78 100644
--- a/lib/libevent/event.c
+++ b/lib/libevent/event.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: event.c,v 1.35 2014/10/29 22:47:29 bluhm Exp $ */
+/* $OpenBSD: event.c,v 1.36 2014/10/30 16:45:37 bluhm Exp $ */
/*
* Copyright (c) 2000-2004 Niels Provos <provos@citi.umich.edu>
@@ -135,12 +135,12 @@ event_base_new(void)
detect_monotonic();
gettime(base, &base->event_tv);
-
+
min_heap_ctor(&base->timeheap);
TAILQ_INIT(&base->eventqueue);
base->sig.ev_signal_pair[0] = -1;
base->sig.ev_signal_pair[1] = -1;
-
+
base->evbase = NULL;
for (i = 0; eventops[i] && !base->evbase; i++) {
base->evsel = eventops[i];
@@ -151,7 +151,7 @@ event_base_new(void)
if (base->evbase == NULL)
event_errx(1, "%s: no event mechanism available", __func__);
- if (!issetugid() && getenv("EVENT_SHOW_METHOD"))
+ if (!issetugid() && getenv("EVENT_SHOW_METHOD"))
event_msgx("libevent using: %s", base->evsel->name);
/* allocate a single active event queue */
@@ -340,7 +340,7 @@ event_process_active(struct event_base *base)
event_queue_remove(base, ev, EVLIST_ACTIVE);
else
event_del(ev);
-
+
/* Allows deletes to work */
ncalls = ev->ev_ncalls;
ev->ev_pncalls = &ncalls;
@@ -471,13 +471,13 @@ event_base_loop(struct event_base *base, int flags)
if (!base->event_count_active && !(flags & EVLOOP_NONBLOCK)) {
timeout_next(base, &tv_p);
} else {
- /*
+ /*
* if we have active events, we just poll new events
* without waiting.
*/
timerclear(&tv);
}
-
+
/* If we have no events, we just exit */
if (!event_haveevents(base)) {
event_debug(("%s: no events registered.", __func__));
@@ -708,14 +708,14 @@ event_add(struct event *ev, const struct timeval *tv)
event_queue_insert(base, ev, EVLIST_INSERTED);
}
- /*
+ /*
* we should change the timout state only if the previous event
* addition succeeded.
*/
if (res != -1 && tv != NULL) {
struct timeval now;
- /*
+ /*
* we already reserved memory above for the case where we
* are not replacing an exisiting timeout.
*/
@@ -734,7 +734,7 @@ event_add(struct event *ev, const struct timeval *tv)
/* Abort loop */
*ev->ev_pncalls = 0;
}
-
+
event_queue_remove(base, ev, EVLIST_ACTIVE);
}
@@ -971,7 +971,7 @@ event_get_version(void)
return (_EVENT_VERSION);
}
-/*
+/*
* No thread-safe interface needed - the information should be the same
* for all threads.
*/
diff --git a/lib/libevent/event.h b/lib/libevent/event.h
index 1a9fb52d147..ba69f9101b3 100644
--- a/lib/libevent/event.h
+++ b/lib/libevent/event.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: event.h,v 1.27 2014/10/08 20:14:19 bluhm Exp $ */
+/* $OpenBSD: event.h,v 1.28 2014/10/30 16:45:37 bluhm Exp $ */
/*
* Copyright (c) 2000-2007 Niels Provos <provos@citi.umich.edu>
@@ -128,7 +128,7 @@
callbacks have been registered for a given URI.
@section evrpc A framework for RPC servers and clients
-
+
libevents provides a framework for creating RPC servers and clients. It
takes care of marshaling and unmarshaling all data structures.
@@ -290,13 +290,13 @@ int event_base_dispatch(struct event_base *);
/**
Get the kernel event notification mechanism used by libevent.
-
+
@param eb the event_base structure returned by event_base_new()
@return a string identifying the kernel event mechanism (kqueue, epoll, etc.)
*/
const char *event_base_get_method(struct event_base *);
-
-
+
+
/**
Deallocate all memory associated with an event_base, and free the base.
@@ -631,7 +631,7 @@ int event_pending(struct event *ev, short event, struct timeval *tv);
@param ev an event structure to be tested
@return 1 if the structure has been initialized, or 0 if it has not been
- initialized
+ initialized
*/
#define event_initialized(ev) ((ev)->ev_flags & EVLIST_INIT)
@@ -796,7 +796,7 @@ struct bufferevent {
enabling the bufferevent for the first time.
@param fd the file descriptor from which data is read and written to.
- This file descriptor is not allowed to be a pipe(2).
+ This file descriptor is not allowed to be a pipe(2).
@param readcb callback to invoke when there is data to be read, or NULL if
no callback is desired
@param writecb callback to invoke when the file descriptor is ready for
@@ -806,7 +806,7 @@ struct bufferevent {
@param cbarg an argument that will be supplied to each of the callbacks
(readcb, writecb, and errorcb)
@return a pointer to a newly allocated bufferevent struct, or NULL if an
- error occurred
+ error occurred
@see bufferevent_base_set(), bufferevent_free()
*/
struct bufferevent *bufferevent_new(int fd,
@@ -970,7 +970,7 @@ void bufferevent_setwatermark(struct bufferevent *bufev, short events,
Allocate storage for a new evbuffer.
@return a pointer to a newly allocated evbuffer struct, or NULL if an error
- occurred
+ occurred
*/
struct evbuffer *evbuffer_new(void);
diff --git a/lib/libevent/event_tagging.c b/lib/libevent/event_tagging.c
index e78cb3a0d3d..4716a7ef1d8 100644
--- a/lib/libevent/event_tagging.c
+++ b/lib/libevent/event_tagging.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: event_tagging.c,v 1.9 2014/10/29 22:47:29 bluhm Exp $ */
+/* $OpenBSD: event_tagging.c,v 1.10 2014/10/30 16:45:37 bluhm Exp $ */
/*
* Copyright (c) 2003, 2004 Niels Provos <provos@citi.umich.edu>
@@ -58,7 +58,7 @@ evtag_init(void)
event_err(1, "%s: malloc", __func__);
}
-/*
+/*
* We encode integer's by nibbles; the first nibble contains the number
* of significant nibbles - 1; this allows us to encode up to 64-bit
* integers. This function is byte-order independent.
@@ -318,7 +318,7 @@ evtag_unmarshal(struct evbuffer *src, ev_uint32_t *ptag, struct evbuffer *dst)
if (EVBUFFER_LENGTH(src) < len)
return (-1);
-
+
if (evbuffer_add(dst, EVBUFFER_DATA(src), len) == -1)
return (-1);
diff --git a/lib/libevent/kqueue.c b/lib/libevent/kqueue.c
index 592e87c429b..66308a020aa 100644
--- a/lib/libevent/kqueue.c
+++ b/lib/libevent/kqueue.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kqueue.c,v 1.35 2014/10/29 22:47:29 bluhm Exp $ */
+/* $OpenBSD: kqueue.c,v 1.36 2014/10/30 16:45:37 bluhm Exp $ */
/*
* Copyright 2000-2002 Niels Provos <provos@citi.umich.edu>
@@ -91,7 +91,7 @@ kq_init(struct event_base *base)
return (NULL);
/* Initalize the kernel queue */
-
+
if ((kq = kqueue()) == -1) {
event_warn("kqueue");
free (kqueueop);
@@ -162,7 +162,7 @@ kq_insert(struct kqop *kqop, struct kevent *kev)
memcpy(&kqop->changes[kqop->nchanges++], kev, sizeof(struct kevent));
event_debug(("%s: fd %d %s%s",
- __func__, (int)kev->ident,
+ __func__, (int)kev->ident,
kev->filter == EVFILT_READ ? "EVFILT_READ" : "EVFILT_WRITE",
kev->flags == EV_DELETE ? " (del)" : ""));
@@ -195,7 +195,7 @@ kq_dispatch(struct event_base *base, void *arg, struct timeval *tv)
kqop->nchanges = 0;
if (res == -1) {
if (errno != EINTR) {
- event_warn("kevent");
+ event_warn("kevent");
return (-1);
}
@@ -291,13 +291,13 @@ kq_add(void *arg, struct event *ev)
assert(nsignal >= 0 && nsignal < NSIG);
if (TAILQ_EMPTY(&kqop->evsigevents[nsignal])) {
struct timespec timeout = { 0, 0 };
-
+
memset(&kev, 0, sizeof(kev));
kev.ident = nsignal;
kev.filter = EVFILT_SIGNAL;
kev.flags = EV_ADD;
kev.udata = &kqop->evsigevents[nsignal];
-
+
/* Be ready for the signal if it is sent any
* time between now and the next call to
* kq_dispatch. */
@@ -316,7 +316,7 @@ kq_add(void *arg, struct event *ev)
}
if (ev->ev_events & EV_READ) {
- memset(&kev, 0, sizeof(kev));
+ memset(&kev, 0, sizeof(kev));
kev.ident = ev->ev_fd;
kev.filter = EVFILT_READ;
/* Make it behave like select() and poll() */
@@ -325,7 +325,7 @@ kq_add(void *arg, struct event *ev)
if (!(ev->ev_events & EV_PERSIST))
kev.flags |= EV_ONESHOT;
kev.udata = ev;
-
+
if (kq_insert(kqop, &kev) == -1)
return (-1);
@@ -333,14 +333,14 @@ kq_add(void *arg, struct event *ev)
}
if (ev->ev_events & EV_WRITE) {
- memset(&kev, 0, sizeof(kev));
+ memset(&kev, 0, sizeof(kev));
kev.ident = ev->ev_fd;
kev.filter = EVFILT_WRITE;
kev.flags = EV_ADD;
if (!(ev->ev_events & EV_PERSIST))
kev.flags |= EV_ONESHOT;
kev.udata = ev;
-
+
if (kq_insert(kqop, &kev) == -1)
return (-1);
@@ -370,7 +370,7 @@ kq_del(void *arg, struct event *ev)
kev.ident = nsignal;
kev.filter = EVFILT_SIGNAL;
kev.flags = EV_DELETE;
-
+
/* Because we insert signal events
* immediately, we need to delete them
* immediately, too */
@@ -387,11 +387,11 @@ kq_del(void *arg, struct event *ev)
}
if (ev->ev_events & EV_READ) {
- memset(&kev, 0, sizeof(kev));
+ memset(&kev, 0, sizeof(kev));
kev.ident = ev->ev_fd;
kev.filter = EVFILT_READ;
kev.flags = EV_DELETE;
-
+
if (kq_insert(kqop, &kev) == -1)
return (-1);
@@ -399,11 +399,11 @@ kq_del(void *arg, struct event *ev)
}
if (ev->ev_events & EV_WRITE) {
- memset(&kev, 0, sizeof(kev));
+ memset(&kev, 0, sizeof(kev));
kev.ident = ev->ev_fd;
kev.filter = EVFILT_WRITE;
kev.flags = EV_DELETE;
-
+
if (kq_insert(kqop, &kev) == -1)
return (-1);
diff --git a/lib/libevent/log.c b/lib/libevent/log.c
index 9ef9ac56634..128028e2dc7 100644
--- a/lib/libevent/log.c
+++ b/lib/libevent/log.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: log.c,v 1.10 2014/10/29 22:47:29 bluhm Exp $ */
+/* $OpenBSD: log.c,v 1.11 2014/10/30 16:45:37 bluhm Exp $ */
/*
* log.c
@@ -49,15 +49,15 @@
#include "event.h"
#include "log.h"
-static void _warn_helper(int severity, int log_errno, const char *fmt,
- va_list ap);
-static void event_log(int severity, const char *msg);
+static void _warn_helper(int severity, int log_errno, const char *fmt,
+ va_list ap);
+static void event_log(int severity, const char *msg);
void
event_err(int eval, const char *fmt, ...)
{
va_list ap;
-
+
va_start(ap, fmt);
_warn_helper(_EVENT_LOG_ERR, errno, fmt, ap);
va_end(ap);
@@ -68,7 +68,7 @@ void
event_warn(const char *fmt, ...)
{
va_list ap;
-
+
va_start(ap, fmt);
_warn_helper(_EVENT_LOG_WARN, errno, fmt, ap);
va_end(ap);
@@ -78,7 +78,7 @@ void
event_errx(int eval, const char *fmt, ...)
{
va_list ap;
-
+
va_start(ap, fmt);
_warn_helper(_EVENT_LOG_ERR, -1, fmt, ap);
va_end(ap);
@@ -89,7 +89,7 @@ void
event_warnx(const char *fmt, ...)
{
va_list ap;
-
+
va_start(ap, fmt);
_warn_helper(_EVENT_LOG_WARN, -1, fmt, ap);
va_end(ap);
@@ -99,7 +99,7 @@ void
event_msgx(const char *fmt, ...)
{
va_list ap;
-
+
va_start(ap, fmt);
_warn_helper(_EVENT_LOG_MSG, -1, fmt, ap);
va_end(ap);
@@ -109,7 +109,7 @@ void
_event_debugx(const char *fmt, ...)
{
va_list ap;
-
+
va_start(ap, fmt);
_warn_helper(_EVENT_LOG_DEBUG, -1, fmt, ap);
va_end(ap);
diff --git a/lib/libevent/poll.c b/lib/libevent/poll.c
index 37115efad45..34884b930d7 100644
--- a/lib/libevent/poll.c
+++ b/lib/libevent/poll.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: poll.c,v 1.20 2014/10/29 22:47:29 bluhm Exp $ */
+/* $OpenBSD: poll.c,v 1.21 2014/10/30 16:45:37 bluhm Exp $ */
/*
* Copyright 2000-2003 Niels Provos <provos@citi.umich.edu>
@@ -142,7 +142,7 @@ poll_dispatch(struct event_base *base, void *arg, struct timeval *tv)
if (res == -1) {
if (errno != EINTR) {
- event_warn("poll");
+ event_warn("poll");
return (-1);
}
@@ -338,7 +338,7 @@ poll_del(void *arg, struct event *ev)
--pop->nfds;
if (i != pop->nfds) {
- /*
+ /*
* Shift the last pollfd down into the now-unoccupied
* position.
*/
diff --git a/lib/libevent/signal.c b/lib/libevent/signal.c
index ff5fdd2a7e9..c87e6c94145 100644
--- a/lib/libevent/signal.c
+++ b/lib/libevent/signal.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: signal.c,v 1.23 2014/10/29 22:47:29 bluhm Exp $ */
+/* $OpenBSD: signal.c,v 1.24 2014/10/30 16:45:37 bluhm Exp $ */
/*
* Copyright 2000-2002 Niels Provos <provos@citi.umich.edu>
@@ -67,7 +67,7 @@ evsignal_init(struct event_base *base)
{
int i, flags;
- /*
+ /*
* Our signal handler is going to write to one end of the socket
* pair to wake up our event loop. The event loop then scans for
* signals that got delivered.
@@ -255,7 +255,7 @@ evsignal_process(struct event_base *base)
struct event *ev, *next_ev;
sig_atomic_t ncalls;
int i;
-
+
base->sig.evsignal_caught = 0;
for (i = 1; i < NSIG; ++i) {
ncalls = sig->evsigcaught[i];