aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt8
-rw-r--r--config.h.in2
-rw-r--r--src/libutil/util.h1
-rw-r--r--src/lua/lua_redis.c4
4 files changed, 12 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index dbec0ceff..2d59bd0cc 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1078,10 +1078,16 @@ ENDIF(HAVE_SIGINFO_H)
# Some hack for libevent 2.0
CHECK_C_SOURCE_COMPILES ("#include <event.h>
- #if _EVENT_NUMERIC_VERSION < 0x02000000
+ #if !defined(LIBEVENT_VERSION_NUMBER) || LIBEVENT_VERSION_NUMBER < 0x02000000
#error Unsupported
#endif
int main() { return 0;}" HAVE_LIBEVENT2)
+CHECK_C_SOURCE_COMPILES ("#include <event2/event.h>
+ int main() { return EVENT_BASE_FLAG_NO_CACHE_TIME; }"
+ HAVE_EVENT_NO_CACHE_TIME_FLAG)
+LIST(APPEND CMAKE_REQUIRED_LIBRARIES "event")
+CHECK_SYMBOL_EXISTS(event_base_update_cache_time "sys/types.h;event.h"
+ HAVE_EVENT_NO_CACHE_TIME_FUNC)
IF(NOT CMAKE_SYSTEM_NAME STREQUAL "SunOS")
IF(HAVE_CLOCK_GETTIME)
diff --git a/config.h.in b/config.h.in
index cb38c87f4..66f287e03 100644
--- a/config.h.in
+++ b/config.h.in
@@ -42,6 +42,8 @@
#cmakedefine HAVE_IPV6_V6ONLY 1
#cmakedefine HAVE_LIBAIO_H 1
#cmakedefine HAVE_LIBEVENT2 1
+#cmakedefine HAVE_EVENT_NO_CACHE_TIME_FLAG 1
+#cmakedefine HAVE_EVENT_NO_CACHE_TIME_FUNC 1
#cmakedefine HAVE_LIBGEN_H 1
#cmakedefine HAVE_LIBUTIL_H 1
#cmakedefine HAVE_LOCALE_H 1
diff --git a/src/libutil/util.h b/src/libutil/util.h
index 875388432..e97593d21 100644
--- a/src/libutil/util.h
+++ b/src/libutil/util.h
@@ -11,6 +11,7 @@
#ifdef HAVE_NETDB_H
#include <netdb.h>
#endif
+
#include <event.h>
#include <time.h>
diff --git a/src/lua/lua_redis.c b/src/lua/lua_redis.c
index 74f446c4f..65c0609f9 100644
--- a/src/lua/lua_redis.c
+++ b/src/lua/lua_redis.c
@@ -1006,7 +1006,7 @@ lua_redis_make_request (lua_State *L)
lua_pop (L, 1);
lua_pushstring (L, "timeout");
- lua_gettable (L, -2);
+ lua_gettable (L, 1);
if (lua_type (L, -1) == LUA_TNUMBER) {
timeout = lua_tonumber (L, -1);
}
@@ -1015,7 +1015,7 @@ lua_redis_make_request (lua_State *L)
lua_pushstring (L, "args");
- lua_gettable (L, -2);
+ lua_gettable (L, 1);
lua_redis_parse_args (L, -1, cmd, &sp_ud->args, &sp_ud->arglens,
&sp_ud->nargs);
lua_pop (L, 1);