summaryrefslogtreecommitdiff
path: root/ev_kqueue.c
diff options
context:
space:
mode:
authorroot <root>2007-11-06 00:10:04 +0000
committerroot <root>2007-11-06 00:10:04 +0000
commitdeff62d26ff4c1324816c04c0c6db1e4db435870 (patch)
treea87ff66d97dd24912b1eee812549f8d52ea41f5b /ev_kqueue.c
parent22c618bcb055597260be9be3a5815e08a4cea996 (diff)
better error handling
Diffstat (limited to 'ev_kqueue.c')
-rw-r--r--ev_kqueue.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/ev_kqueue.c b/ev_kqueue.c
index 24c3015..4fefcee 100644
--- a/ev_kqueue.c
+++ b/ev_kqueue.c
@@ -85,7 +85,12 @@ kqueue_poll (EV_P_ ev_tstamp timeout)
kqueue_changecnt = 0;
if (res < 0)
- return;
+ {
+ if (errno != EINTR)
+ syserr ();
+
+ return;
+ }
for (i = 0; i < res; ++i)
{
@@ -118,9 +123,9 @@ kqueue_poll (EV_P_ ev_tstamp timeout)
if (expect_false (res == kqueue_eventmax))
{
- free (kqueue_events);
+ ev_free (kqueue_events);
kqueue_eventmax = array_roundsize (kqueue_events, kqueue_eventmax << 1);
- kqueue_events = malloc (sizeof (struct kevent) * kqueue_eventmax);
+ kqueue_events = ev_malloc (sizeof (struct kevent) * kqueue_eventmax);
}
}
@@ -159,7 +164,7 @@ kqueue_init (EV_P_ int flags)
method_poll = kqueue_poll;
kqueue_eventmax = 64; /* intiial number of events receivable per poll */
- kqueue_events = malloc (sizeof (struct kevent) * kqueue_eventmax);
+ kqueue_events = ev_malloc (sizeof (struct kevent) * kqueue_eventmax);
kqueue_changes = 0;
kqueue_changemax = 0;
@@ -173,8 +178,8 @@ kqueue_destroy (EV_P)
{
close (kqueue_fd);
- free (kqueue_events);
- free (kqueue_changes);
+ ev_free (kqueue_events);
+ ev_free (kqueue_changes);
}
static void