From 1d308e88139bd549b99cddae4025ce4d499070b7 Mon Sep 17 00:00:00 2001 From: Niels Provos Date: Sat, 17 Dec 2005 20:25:22 +0000 Subject: [PATCH] mostly whitespace fixes from OpenBSD via Brad svn:r192 --- event.c | 2 ++ poll.c | 2 +- signal.c | 12 +++++++----- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/event.c b/event.c index 0d6de870..4c8aeed3 100644 --- a/event.c +++ b/event.c @@ -24,7 +24,9 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#ifdef HAVE_CONFIG_H #include "config.h" +#endif #ifdef WIN32 #define WIN32_LEAN_AND_MEAN diff --git a/poll.c b/poll.c index da35b20a..437b94a2 100644 --- a/poll.c +++ b/poll.c @@ -93,7 +93,7 @@ poll_init(void) if (getenv("EVENT_NOPOLL")) return (NULL); - if (!(pollop = calloc(1, sizeof(struct pollop)))) + if (!(pollop = calloc(1, sizeof(struct pollop)))) return (NULL); evsignal_init(&pollop->evsigmask); diff --git a/signal.c b/signal.c index 978b7ba2..8a6963b1 100644 --- a/signal.c +++ b/signal.c @@ -26,7 +26,9 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#ifdef HAVE_CONFIG_H #include "config.h" +#endif #include #ifdef HAVE_SYS_TIME_H @@ -110,12 +112,12 @@ int evsignal_add(sigset_t *evsigmask, struct event *ev) { int evsignal; - + if (ev->ev_events & (EV_READ|EV_WRITE)) event_errx(1, "%s: EV_SIGNAL incompatible use", __func__); evsignal = EVENT_SIGNAL(ev); sigaddset(evsigmask, evsignal); - + return (0); } @@ -153,7 +155,7 @@ evsignal_recalc(sigset_t *evsigmask) { struct sigaction sa; struct event *ev; - + if (!ev_signal_added) { ev_signal_added = 1; event_add(&ev_signal, NULL); @@ -165,13 +167,13 @@ evsignal_recalc(sigset_t *evsigmask) if (sigprocmask(SIG_BLOCK, evsigmask, NULL) == -1) return (-1); - + /* Reinstall our signal handler. */ memset(&sa, 0, sizeof(sa)); sa.sa_handler = evsignal_handler; sa.sa_mask = *evsigmask; sa.sa_flags |= SA_RESTART; - + TAILQ_FOREACH(ev, &signalqueue, ev_signal_next) { if (sigaction(EVENT_SIGNAL(ev), &sa, NULL) == -1) return (-1); -- 2.40.0