From 90c39522a2217a7bbd480f759ffc1456a29474ef Mon Sep 17 00:00:00 2001 From: Nils Maier Date: Sun, 11 Aug 2013 15:34:32 +0200 Subject: [PATCH] Libuv: Compatiblity fix with master --- configure.ac | 1 + src/LibuvEventPoll.cc | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/configure.ac b/configure.ac index 4936778f..3f57d832 100644 --- a/configure.ac +++ b/configure.ac @@ -220,6 +220,7 @@ int main() { return uv_poll_init_socket(); } if test "x$have_libuv" = "xyes"; then AC_DEFINE([HAVE_LIBUV], [1], [Define to 1 if you have libuv.]) + AC_CHECK_FUNCS([uv_last_error]) elif test "x$with_libuv_requested" = "xyes"; then ARIA2_DEP_NOT_MET([libuv]) fi diff --git a/src/LibuvEventPoll.cc b/src/LibuvEventPoll.cc index 1c415d2d..321721df 100644 --- a/src/LibuvEventPoll.cc +++ b/src/LibuvEventPoll.cc @@ -179,9 +179,14 @@ int LibuvEventPoll::translateEvents(EventPoll::EventType events) void LibuvEventPoll::pollCallback(KPoll* poll, int status, int events) { +#if HAVE_UV_LAST_ERROR if (status == -1) { uv_err_t err = uv_last_error(loop_); switch (err.code) { +#else + if (status < 0) { + switch (status) { +#endif case UV_EAGAIN: case UV_EINTR: return;