summaryrefslogtreecommitdiff
path: root/devpoll.c
diff options
context:
space:
mode:
authorNiels Provos <provos@gmail.com>2005-03-29 07:03:10 +0000
committerNiels Provos <provos@gmail.com>2005-03-29 07:03:10 +0000
commitfbdaf3ab6229f036c0561a347f06b7f913a2b165 (patch)
treea836e38ea4ccd6b3e9cb487c12a96968beefb49e /devpoll.c
parent99442c6f00c16502afa517e063ff15e20c00212a (diff)
downloadlibevent-fbdaf3ab6229f036c0561a347f06b7f913a2b165.tar.gz
debugging callbacks from Nick Mathewson <nickm@freehaven.net>
svn:r136
Diffstat (limited to 'devpoll.c')
-rw-r--r--devpoll.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/devpoll.c b/devpoll.c
index 99ad4174..c4ba33f0 100644
--- a/devpoll.c
+++ b/devpoll.c
@@ -44,18 +44,11 @@
#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;
@@ -113,7 +106,7 @@ devpoll_init(void)
/* 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);
}
@@ -158,7 +151,7 @@ devpoll_recalc(struct event_base *base, void *arg, int max)
fds = realloc(devpollop->fds, nfds * sizeof(struct evdevpoll));
if (fds == NULL) {
- log_error("realloc");
+ event_warn("realloc");
return (-1);
}
devpollop->fds = fds;
@@ -195,7 +188,7 @@ devpoll_dispatch(struct event_base *base, void *arg, struct timeval *tv)
if (res == -1) {
if (errno != EINTR) {
- log_error("ioctl: DP_POLL");
+ event_warn("ioctl: DP_POLL");
return (-1);
}
@@ -204,7 +197,7 @@ devpoll_dispatch(struct event_base *base, void *arg, struct timeval *tv)
} 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;