summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Changes3
-rw-r--r--ev.c12
-rw-r--r--ev_epoll.c4
-rw-r--r--ev_kqueue.c4
-rw-r--r--ev_poll.c2
-rw-r--r--ev_port.c6
-rw-r--r--ev_select.c2
7 files changed, 18 insertions, 15 deletions
diff --git a/Changes b/Changes
index 2280fb6..d331ebe 100644
--- a/Changes
+++ b/Changes
@@ -6,7 +6,7 @@ WISH? monotonic clocks times/GetTickCount for coarse corrections?
backend by assuming the kernel event mask hasn't changed if
ADD fails with EEXIST.
- work around spurious event notification bugs in epoll by using
- an 8-bit generation counter. recreate kernel state if we receive
+ a 32-bit generation counter. recreate kernel state if we receive
spurious notifications or unwanted events.
- use memset to initialise most arrays now and do away with the
init functions.
@@ -16,6 +16,7 @@ WISH? monotonic clocks times/GetTickCount for coarse corrections?
to have a struct AND a function called ev_loop).
- fix a bug where ev_default would not initialise the default
loop again after it was destroyed with ev_default_destroy.
+ - rename syserr to ev_syserr to avoid name clashes when embedding.
3.45 Tue Oct 21 21:59:26 CEST 2008
- disable inotify usage on linux <2.6.25, as it is broken
diff --git a/ev.c b/ev.c
index a6077f8..5ed98f3 100644
--- a/ev.c
+++ b/ev.c
@@ -390,7 +390,7 @@ ev_set_syserr_cb (void (*cb)(const char *msg))
}
static void noinline
-syserr (const char *msg)
+ev_syserr (const char *msg)
{
if (!msg)
msg = "(libev) system error";
@@ -452,7 +452,10 @@ typedef struct
unsigned char events;
unsigned char reify;
unsigned char emask; /* the epoll backend stores the actual kernel mask in here */
- unsigned char egen; /* generation counter to counter epoll bugs */
+ unsigned char unused;
+#if EV_USE_EPOLL
+ unsigned int egen; /* generation counter to counter epoll bugs */
+#endif
#if EV_SELECT_IS_WINSOCKET
SOCKET handle;
#endif
@@ -1000,7 +1003,7 @@ evpipe_init (EV_P)
#endif
{
while (pipe (evpipe))
- syserr ("(libev) error creating signal/async pipe");
+ ev_syserr ("(libev) error creating signal/async pipe");
fd_intern (evpipe [0]);
fd_intern (evpipe [1]);
@@ -1658,8 +1661,7 @@ ev_default_fork (void)
struct ev_loop *loop = ev_default_loop_ptr;
#endif
- if (backend)
- postfork = 1; /* must be in line with ev_loop_fork */
+ ev_loop_fork (EV_A);
}
/*****************************************************************************/
diff --git a/ev_epoll.c b/ev_epoll.c
index f1e16ab..b2b4952 100644
--- a/ev_epoll.c
+++ b/ev_epoll.c
@@ -123,7 +123,7 @@ epoll_poll (EV_P_ ev_tstamp timeout)
if (expect_false (eventcnt < 0))
{
if (errno != EINTR)
- syserr ("(libev) epoll_wait");
+ ev_syserr ("(libev) epoll_wait");
return;
}
@@ -205,7 +205,7 @@ epoll_fork (EV_P)
close (backend_fd);
while ((backend_fd = epoll_create (256)) < 0)
- syserr ("(libev) epoll_create");
+ ev_syserr ("(libev) epoll_create");
fcntl (backend_fd, F_SETFD, FD_CLOEXEC);
diff --git a/ev_kqueue.c b/ev_kqueue.c
index c8dc69a..63828d6 100644
--- a/ev_kqueue.c
+++ b/ev_kqueue.c
@@ -101,7 +101,7 @@ kqueue_poll (EV_P_ ev_tstamp timeout)
if (expect_false (res < 0))
{
if (errno != EINTR)
- syserr ("(libev) kevent");
+ ev_syserr ("(libev) kevent");
return;
}
@@ -184,7 +184,7 @@ kqueue_fork (EV_P)
close (backend_fd);
while ((backend_fd = kqueue ()) < 0)
- syserr ("(libev) kqueue");
+ ev_syserr ("(libev) kqueue");
fcntl (backend_fd, F_SETFD, FD_CLOEXEC);
diff --git a/ev_poll.c b/ev_poll.c
index e9f5e51..5b82b29 100644
--- a/ev_poll.c
+++ b/ev_poll.c
@@ -98,7 +98,7 @@ poll_poll (EV_P_ ev_tstamp timeout)
else if (errno == ENOMEM && !syserr_cb)
fd_enomem (EV_A);
else if (errno != EINTR)
- syserr ("(libev) poll");
+ ev_syserr ("(libev) poll");
}
else
for (p = polls; res; ++p)
diff --git a/ev_port.c b/ev_port.c
index 0b7b066..4b41bb7 100644
--- a/ev_port.c
+++ b/ev_port.c
@@ -59,7 +59,7 @@ port_associate_and_check (EV_P_ int fd, int ev)
if (errno == EBADFD)
fd_kill (EV_A_ fd);
else
- syserr ("(libev) port_associate");
+ ev_syserr ("(libev) port_associate");
}
}
@@ -92,7 +92,7 @@ port_poll (EV_P_ ev_tstamp timeout)
if (res < 0)
{
if (errno != EINTR && errno != ETIME)
- syserr ("(libev) port_getn");
+ ev_syserr ("(libev) port_getn");
return;
}
@@ -153,7 +153,7 @@ port_fork (EV_P)
close (backend_fd);
while ((backend_fd = port_create ()) < 0)
- syserr ("(libev) port");
+ ev_syserr ("(libev) port");
fcntl (backend_fd, F_SETFD, FD_CLOEXEC);
diff --git a/ev_select.c b/ev_select.c
index 93d84cf..6ffb93c 100644
--- a/ev_select.c
+++ b/ev_select.c
@@ -196,7 +196,7 @@ select_poll (EV_P_ ev_tstamp timeout)
else if (errno == ENOMEM && !syserr_cb)
fd_enomem (EV_A);
else if (errno != EINTR)
- syserr ("(libev) select");
+ ev_syserr ("(libev) select");
return;
}