Browse Source

Libuv: Compatiblity fix with master

Nils Maier 12 years ago
parent
commit
90c39522a2
2 changed files with 6 additions and 0 deletions
  1. 1 0
      configure.ac
  2. 5 0
      src/LibuvEventPoll.cc

+ 1 - 0
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

+ 5 - 0
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;