SUBDIRS = . sample test
-EXTRA_DIST = acconfig.h err.c event.h event-internal.h evsignal.h event.3 \
+EXTRA_DIST = acconfig.h event.h event-internal.h log.h evsignal.h event.3 \
kqueue.c epoll_sub.c epoll.c select.c rtsig.c poll.c signal.c \
devpoll.c \
sample/Makefile.am sample/Makefile.in sample/event-test.c \
test/Makefile.am test/Makefile.in test/bench.c test/regress.c \
test/test-eof.c test/test-weof.c test/test-time.c \
test/test-init.c test/test.sh \
- compat/err.h compat/sys/queue.h compat/sys/tree.h compat/sys/_time.h \
+ compat/sys/queue.h compat/sys/tree.h compat/sys/_time.h \
WIN32-Code WIN32-Code/config.h WIN32-Code/misc.c \
WIN32-Code/win32.c WIN32-Code/misc.h \
WIN32-Prj WIN32-Prj/event_test WIN32-Prj/event_test/event_test.dsp \
lib_LIBRARIES = libevent.a
-libevent_a_SOURCES = event.c buffer.c evbuffer.c
+libevent_a_SOURCES = event.c buffer.c evbuffer.c log.c
libevent_a_LIBADD = @LIBOBJS@
include_HEADERS = event.h
#include <sys/ioctl.h>
#endif
-#include <err.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
AC_LIBOBJ(signal)
fi
-AC_REPLACE_FUNCS(err)
-
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_CHECK_TYPE(u_int64_t, unsigned long long)
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
-#include <err.h>
#include <assert.h>
-#ifdef USE_LOG
-#include "log.h"
-#else
-#define LOG_DBG(x)
-#define log_error warn
-#endif
-
#include "event.h"
#include "evsignal.h"
+#include "log.h"
extern volatile sig_atomic_t evsignal_caught;
/* Initialize the kernel queue */
if ((dpfd = open("/dev/poll", O_RDWR)) == -1) {
- log_error("open: /dev/poll");
+ event_warn("open: /dev/poll");
free(devpollop);
return (NULL);
}
fds = realloc(devpollop->fds, nfds * sizeof(struct evdevpoll));
if (fds == NULL) {
- log_error("realloc");
+ event_warn("realloc");
return (-1);
}
devpollop->fds = fds;
if (res == -1) {
if (errno != EINTR) {
- log_error("ioctl: DP_POLL");
+ event_warn("ioctl: DP_POLL");
return (-1);
}
} else if (evsignal_caught)
evsignal_process();
- LOG_DBG((LOG_MISC, 80, "%s: devpoll_wait reports %d", __func__, res));
+ event_debug(("%s: devpoll_wait reports %d", __func__, res));
for (i = 0; i < res; i++) {
int which = 0;
#include <string.h>
#include <unistd.h>
#include <errno.h>
-#include <err.h>
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif
-#ifdef USE_LOG
-#include "log.h"
-#else
-#define LOG_DBG(x)
-#define log_error warn
-#endif
-
#include "event.h"
#include "evsignal.h"
+#include "log.h"
extern volatile sig_atomic_t evsignal_caught;
#ifdef HAVE_SETFD
#define FD_CLOSEONEXEC(x) do { \
if (fcntl(x, F_SETFD, 1) == -1) \
- warn("fcntl(%d, F_SETFD)", x); \
+ event_warn("fcntl(%d, F_SETFD)", x); \
} while (0)
#else
#define FD_CLOSEONEXEC(x)
/* Initalize the kernel queue */
if ((epfd = epoll_create(nfiles)) == -1) {
- log_error("epoll_create");
+ event_warn("epoll_create");
return (NULL);
}
fds = realloc(epollop->fds, nfds * sizeof(struct evepoll));
if (fds == NULL) {
- log_error("realloc");
+ event_warn("realloc");
return (-1);
}
epollop->fds = fds;
if (res == -1) {
if (errno != EINTR) {
- log_error("epoll_wait");
+ event_warn("epoll_wait");
return (-1);
}
} else if (evsignal_caught)
evsignal_process();
- LOG_DBG((LOG_MISC, 80, "%s: epoll_wait reports %d", __func__, res));
+ event_debug(("%s: epoll_wait reports %d", __func__, res));
for (i = 0; i < res; i++) {
int which = 0;
#endif
#include <errno.h>
#include <string.h>
-#include <err.h>
#include <assert.h>
-#ifdef USE_LOG
-#include "log.h"
-#else
-#define LOG_DBG(x)
-#define log_error(x) perror(x)
-#endif
-
#include "event.h"
#include "event-internal.h"
+#include "log.h"
#ifdef HAVE_SELECT
extern const struct eventop selectops;
int i;
if ((current_base = calloc(1, sizeof(struct event_base))) == NULL)
- err(1, "%s: calloc");
+ event_err(1, "%s: calloc");
event_sigcb = NULL;
event_gotsig = 0;
gettimeofday(¤t_base->event_tv, NULL);
-#if defined(USE_LOG) && defined(USE_DEBUG)
- log_to(stderr);
- log_debug_cmd(LOG_MISC, 80);
-#endif
-
RB_INIT(¤t_base->timetree);
TAILQ_INIT(¤t_base->eventqueue);
TAILQ_INIT(&signalqueue);
}
if (current_base->evbase == NULL)
- errx(1, "%s: no event mechanism available", __func__);
+ event_errx(1, "%s: no event mechanism available", __func__);
if (getenv("EVENT_SHOW_METHOD"))
- fprintf(stderr, "libevent using: %s\n",
- current_base->evsel->name);
+ event_msgx("libevent using: %s\n",
+ current_base->evsel->name);
/* allocate a single active event queue */
event_base_priority_init(current_base, 1);
base->activequeues = (struct event_list **)calloc(base->nactivequeues,
npriorities * sizeof(struct event_list *));
if (base->activequeues == NULL)
- err(1, "%s: calloc", __func__);
+ event_err(1, "%s: calloc", __func__);
for (i = 0; i < base->nactivequeues; ++i) {
base->activequeues[i] = malloc(sizeof(struct event_list));
if (base->activequeues[i] == NULL)
- err(1, "%s: malloc", __func__);
+ event_err(1, "%s: malloc", __func__);
TAILQ_INIT(base->activequeues[i]);
}
gettimeofday(&tv, NULL);
if (timercmp(&tv, &base->event_tv, <)) {
struct timeval off;
- LOG_DBG((LOG_MISC, 10,
- "%s: time is running backwards, corrected",
+ event_debug(("%s: time is running backwards, corrected",
__func__));
-
timersub(&base->event_tv, &tv, &off);
timeout_correct(base, &off);
}
const struct eventop *evsel = base->evsel;
void *evbase = base->evbase;
- LOG_DBG((LOG_MISC, 55,
+ event_debug((
"event_add: event: %p, %s%s%scall %p",
ev,
ev->ev_events & EV_READ ? "EV_READ " : " ",
gettimeofday(&now, NULL);
timeradd(&now, tv, &ev->ev_timeout);
- LOG_DBG((LOG_MISC, 55,
+ event_debug((
"event_add: timeout in %d seconds, call %p",
tv->tv_sec, ev->ev_callback));
const struct eventop *evsel;
void *evbase;
- LOG_DBG((LOG_MISC, 80, "event_del: %p, callback %p",
+ event_debug(("event_del: %p, callback %p",
ev, ev->ev_callback));
/* An event without a base has not been added */
assert(tv->tv_sec >= 0);
assert(tv->tv_usec >= 0);
- LOG_DBG((LOG_MISC, 60, "timeout_next: in %d seconds", tv->tv_sec));
+ event_debug(("timeout_next: in %d seconds", tv->tv_sec));
return (0);
}
/* delete this event from the I/O queues */
event_del(ev);
- LOG_DBG((LOG_MISC, 60, "timeout_process: call %p",
+ event_debug(("timeout_process: call %p",
ev->ev_callback));
event_active(ev, EV_TIMEOUT, 1);
}
int docount = 1;
if (!(ev->ev_flags & queue))
- errx(1, "%s: %p(fd %d) not on queue %x", __func__,
- ev, ev->ev_fd, queue);
+ event_errx(1, "%s: %p(fd %d) not on queue %x", __func__,
+ ev, ev->ev_fd, queue);
if (ev->ev_flags & EVLIST_INTERNAL)
docount = 0;
TAILQ_REMOVE(&base->eventqueue, ev, ev_next);
break;
default:
- errx(1, "%s: unknown queue %x", __func__, queue);
+ event_errx(1, "%s: unknown queue %x", __func__, queue);
}
}
if (queue & EVLIST_ACTIVE)
return;
- errx(1, "%s: %p(fd %d) already on queue %x", __func__,
- ev, ev->ev_fd, queue);
+ event_errx(1, "%s: %p(fd %d) already on queue %x", __func__,
+ ev, ev->ev_fd, queue);
}
if (ev->ev_flags & EVLIST_INTERNAL)
TAILQ_INSERT_TAIL(&base->eventqueue, ev, ev_next);
break;
default:
- errx(1, "%s: unknown queue %x", __func__, queue);
+ event_errx(1, "%s: unknown queue %x", __func__, queue);
}
}
int event_dispatch(void);
int event_base_dispatch(struct event_base *);
+#define _EVENT_LOG_DEBUG 0
+#define _EVENT_LOG_MSG 1
+#define _EVENT_LOG_WARN 2
+#define _EVENT_LOG_ERR 3
+typedef void (*event_log_cb)(int severity, const char *msg);
+void event_set_log_callback(event_log_cb cb);
+
/* Associate a different event base with an event */
int event_base_set(struct event_base *, struct event *);
#include <string.h>
#include <unistd.h>
#include <errno.h>
-#include <err.h>
#ifdef HAVE_INTTYPES_H
#include <inttypes.h>
#endif
-#ifdef USE_LOG
-#include "log.h"
-#else
-#define LOG_DBG(x)
-#define log_error warn
-#endif
-
#if defined(HAVE_INTTYPES_H) && !defined(__OpenBSD__) && !defined(__FreeBSD__)
#define INTPTR(x) (intptr_t)x
#else
#endif
#include "event.h"
+#include "log.h"
#define EVLIST_X_KQINKERNEL 0x1000
/* Initalize the kernel queue */
if ((kq = kqueue()) == -1) {
- log_error("kqueue");
+ event_warn("kqueue");
free (kqueueop);
return (NULL);
}
newchange = realloc(kqop->changes,
nevents * sizeof(struct kevent));
if (newchange == NULL) {
- log_error("%s: malloc", __func__);
+ event_warn("%s: malloc", __func__);
return (-1);
}
kqop->changes = newchange;
* the next realloc will pick it up.
*/
if (newresult == NULL) {
- log_error("%s: malloc", __func__);
+ event_warn("%s: malloc", __func__);
return (-1);
}
kqop->events = newresult;
memcpy(&kqop->changes[kqop->nchanges++], kev, sizeof(struct kevent));
- LOG_DBG((LOG_MISC, 70, "%s: fd %d %s%s",
+ event_debug(("%s: fd %d %s%s",
__func__, kev->ident,
kev->filter == EVFILT_READ ? "EVFILT_READ" : "EVFILT_WRITE",
kev->flags == EV_DELETE ? " (del)" : ""));
kqop->nchanges = 0;
if (res == -1) {
if (errno != EINTR) {
- log_error("kevent");
+ event_warn("kevent");
return (-1);
}
return (0);
}
- LOG_DBG((LOG_MISC, 80, "%s: kevent reports %d", __func__, res));
+ event_debug(("%s: kevent reports %d", __func__, res));
for (i = 0; i < res; i++) {
int which = 0;
--- /dev/null
+/* $OpenBSD: err.c,v 1.2 2002/06/25 15:50:15 mickey Exp $ */
+
+/*
+ * log.c
+ *
+ * Based on err.c, which was adapted from OpenBSD libc *err* *warn* code.
+ *
+ * Copyright (c) 2005 Nick Mathewson <nickm@freehaven.net>
+ *
+ * Copyright (c) 2000 Dug Song <dugsong@monkey.org>
+ *
+ * Copyright (c) 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (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 WIN32
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#undef WIN32_LEAN_AND_MEAN
+#include "misc.h"
+#endif
+#include <sys/types.h>
+#include <sys/tree.h>
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#else
+#include <sys/_time.h>
+#endif
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <errno.h>
+#include "event.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 int
+event_vsnprintf(char *str, size_t size, const char *format, va_list args)
+{
+ int r;
+ if (size == 0)
+ return -1;
+#ifdef WIN32
+ r = _vsnprintf(str, size, format, args);
+#else
+ r = vsnprintf(str, size, format, args);
+#endif
+ str[size-1] = '\0';
+ if (r < 0 || ((size_t)r) >= size) {
+ /* different platforms behave differently on overflow;
+ * handle both kinds. */
+ return -1;
+ }
+ return r;
+}
+
+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);
+ exit(eval);
+}
+
+void
+event_warn(const char *fmt, ...)
+{
+ va_list ap;
+
+ va_start(ap, fmt);
+ _warn_helper(_EVENT_LOG_WARN, errno, fmt, ap);
+ va_end(ap);
+}
+
+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);
+ exit(eval);
+}
+
+void
+event_warnx(const char *fmt, ...)
+{
+ va_list ap;
+
+ va_start(ap, fmt);
+ _warn_helper(_EVENT_LOG_WARN, -1, fmt, ap);
+ va_end(ap);
+}
+
+void
+event_msgx(const char *fmt, ...)
+{
+ va_list ap;
+
+ va_start(ap, fmt);
+ _warn_helper(_EVENT_LOG_MSG, -1, fmt, ap);
+ va_end(ap);
+}
+
+void
+_event_debugx(const char *fmt, ...)
+{
+ va_list ap;
+
+ va_start(ap, fmt);
+ _warn_helper(_EVENT_LOG_DEBUG, -1, fmt, ap);
+ va_end(ap);
+}
+
+static void
+_warn_helper(int severity, int log_errno, const char *fmt, va_list ap)
+{
+ char buf[1024];
+ size_t len;
+
+ if (fmt != NULL)
+ event_vsnprintf(buf, sizeof(buf), fmt, ap);
+ else
+ buf[0] = '\0';
+
+ if (log_errno >= 0) {
+ len = strlen(buf);
+ if (len < sizeof(buf)-3) {
+ event_vsnprintf(buf+len, sizeof(buf)-len, ": %s",
+ strerror(log_errno));
+ }
+ }
+
+ event_log(severity, buf);
+}
+
+static event_log_cb log_fn = NULL;
+
+void
+event_set_log_callback(event_log_cb cb)
+{
+ log_fn = cb;
+}
+
+static void
+event_log(int severity, const char *msg)
+{
+ if (log_fn)
+ log_fn(severity, msg);
+ else {
+ const char *severity_str;
+ switch (severity) {
+ case _EVENT_LOG_DEBUG:
+ severity_str = "debug";
+ break;
+ case _EVENT_LOG_MSG:
+ severity_str = "msg";
+ break;
+ case _EVENT_LOG_WARN:
+ severity_str = "warn";
+ break;
+ case _EVENT_LOG_ERR:
+ severity_str = "err";
+ break;
+ default:
+ severity_str = "???";
+ break;
+ }
+ (void)fprintf(stderr, "[%s] %s\n", severity_str, msg);
+ }
+}
--- /dev/null
+/*
+ * Copyright (c) 2000-2004 Niels Provos <provos@citi.umich.edu>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef _LOG_H_
+#define _LOG_H_
+
+void event_err(int eval, const char *fmt, ...);
+void event_warn(const char *fmt, ...);
+void event_errx(int eval, const char *fmt, ...);
+void event_warnx(const char *fmt, ...);
+void event_msgx(const char *fmt, ...);
+void _event_debugx(const char *fmt, ...);
+#undef USE_DEBUG
+#ifdef USE_DEBUG
+#define event_debug(x) _event_debugx x
+#else
+#define event_debug(x)
+#endif
+
+#endif
#include <string.h>
#include <unistd.h>
#include <errno.h>
-#include <err.h>
-
-#ifdef USE_LOG
-#include "log.h"
-#else
-#define LOG_DBG(x)
-#define log_error(x) perror(x)
-#endif
#include "event.h"
#include "event-internal.h"
#include "evsignal.h"
+#include "log.h"
extern volatile sig_atomic_t evsignal_caught;
pop->event_set = realloc(pop->event_set,
count * sizeof(struct pollfd));
if (pop->event_set == NULL) {
- log_error("realloc");
+ event_warn("realloc");
return (-1);
}
pop->event_back = realloc(pop->event_back,
count * sizeof(struct event *));
if (pop->event_back == NULL) {
- log_error("realloc");
+ event_warn("realloc");
return (-1);
}
pop->event_count = count;
if (res == -1) {
if (errno != EINTR) {
- log_error("poll");
+ event_warn("poll");
return (-1);
}
} else if (evsignal_caught)
evsignal_process();
- LOG_DBG((LOG_MISC, 80, "%s: poll reports %d", __func__, res));
+ event_debug(("%s: poll reports %d", __func__, res));
if (res == 0)
return (0);
#define EVLIST_X_NORT 0x1000 /* Skip RT signals (internal) */
#include "event.h"
+#include "log.h"
extern struct event_list signalqueue;
struct rtsigop {
op->toev = malloc(sizeof(*op->toev) * op->max);
if (op->poll == NULL || op->toev == NULL)
- err(1, "%s: malloc");
+ event_err(1, "%s: malloc");
}
return (0);
#include <errno.h>
#include <err.h>
-#ifdef USE_LOG
-#include "log.h"
-#else
-#define LOG_DBG(x)
-#define log_error(x) perror(x)
-#endif
-
#include "event.h"
#include "event-internal.h"
#include "evsignal.h"
+#include "log.h"
#ifndef howmany
#define howmany(x, y) (((x)+((y)-1))/(y))
fdsz = howmany(sop->event_fds + 1, NFDBITS) * sizeof(fd_mask);
if (fdsz > sop->event_fdsz) {
if ((readset = realloc(sop->event_readset, fdsz)) == NULL) {
- log_error("malloc");
+ event_warn("malloc");
return (-1);
}
if ((writeset = realloc(sop->event_writeset, fdsz)) == NULL) {
- log_error("malloc");
+ event_warn("malloc");
free(readset);
return (-1);
}
if (res == -1) {
if (errno != EINTR) {
- log_error("select");
+ event_warn("select");
return (-1);
}
} else if (evsignal_caught)
evsignal_process();
- LOG_DBG((LOG_MISC, 80, "%s: select reports %d", __func__, res));
+ event_debug(("%s: select reports %d", __func__, res));
maxfd = 0;
for (ev = TAILQ_FIRST(&base->eventqueue); ev != NULL; ev = next) {
#include <string.h>
#include <unistd.h>
#include <errno.h>
-#include <err.h>
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif
-#ifdef USE_LOG
-#include "log.h"
-#else
-#define LOG_DBG(x)
-#define log_error(x) perror(x)
-#endif
-
#include "event.h"
#include "evsignal.h"
+#include "log.h"
extern struct event_list signalqueue;
n = read(fd, signals, sizeof(signals));
if (n == -1)
- err(1, "%s: read", __func__);
+ event_err(1, "%s: read", __func__);
event_add(ev, NULL);
}
#ifdef HAVE_SETFD
#define FD_CLOSEONEXEC(x) do { \
if (fcntl(x, F_SETFD, 1) == -1) \
- warn("fcntl(%d, F_SETFD)", x); \
+ event_warn("fcntl(%d, F_SETFD)", x); \
} while (0)
#else
#define FD_CLOSEONEXEC(x)
* signals that got delivered.
*/
if (socketpair(AF_UNIX, SOCK_STREAM, 0, ev_signal_pair) == -1)
- err(1, "%s: socketpair", __func__);
+ event_err(1, "%s: socketpair", __func__);
FD_CLOSEONEXEC(ev_signal_pair[0]);
FD_CLOSEONEXEC(ev_signal_pair[1]);
int evsignal;
if (ev->ev_events & (EV_READ|EV_WRITE))
- errx(1, "%s: EV_SIGNAL incompatible use", __func__);
+ event_errx(1, "%s: EV_SIGNAL incompatible use", __func__);
evsignal = EVENT_SIGNAL(ev);
sigaddset(evsigmask, evsignal);