From cb243f47a0178084044400def0726952ae8c8acf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Tue, 20 Dec 2016 10:51:23 +0200 Subject: [PATCH] Remove usage of LUA_OK LUA_OK is not defined in Lua 5.1. --- server/modules/filter/luafilter/luafilter.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/server/modules/filter/luafilter/luafilter.c b/server/modules/filter/luafilter/luafilter.c index bd351a50e..f6a17d96e 100644 --- a/server/modules/filter/luafilter/luafilter.c +++ b/server/modules/filter/luafilter/luafilter.c @@ -377,7 +377,7 @@ static void * newSession(FILTER *instance, SESSION *session) lua_getglobal(my_instance->global_lua_state, "newSession"); - if (LUA_TFUNCTION && lua_pcall(my_instance->global_lua_state, 0, 0, 0) != LUA_OK) + if (lua_pcall(my_instance->global_lua_state, 0, 0, 0)) { MXS_WARNING("luafilter: Failed to get global variable 'newSession': '%s'." " The newSession entry point will not be called for the global script.", @@ -411,7 +411,7 @@ static void closeSession(FILTER *instance, void *session) lua_getglobal(my_session->lua_state, "closeSession"); - if (LUA_TFUNCTION && lua_pcall(my_session->lua_state, 0, 0, 0) != LUA_OK) + if (lua_pcall(my_session->lua_state, 0, 0, 0)) { MXS_WARNING("luafilter: Failed to get global variable 'closeSession': '%s'." " The closeSession entry point will not be called.", @@ -427,7 +427,7 @@ static void closeSession(FILTER *instance, void *session) lua_getglobal(my_instance->global_lua_state, "closeSession"); - if (lua_pcall(my_instance->global_lua_state, 0, 0, 0) != LUA_OK) + if (lua_pcall(my_instance->global_lua_state, 0, 0, 0)) { MXS_WARNING("luafilter: Failed to get global variable 'closeSession': '%s'." " The closeSession entry point will not be called for the global script.", @@ -502,7 +502,7 @@ static int clientReply(FILTER *instance, void *session, GWBUF *queue) lua_getglobal(my_session->lua_state, "clientReply"); - if (lua_pcall(my_session->lua_state, 0, 0, 0) != LUA_OK) + if (lua_pcall(my_session->lua_state, 0, 0, 0)) { MXS_ERROR("luafilter: Session scope call to 'clientReply' failed: '%s'.", lua_tostring(my_session->lua_state, -1)); @@ -517,7 +517,7 @@ static int clientReply(FILTER *instance, void *session, GWBUF *queue) lua_getglobal(my_instance->global_lua_state, "clientReply"); - if (lua_pcall(my_instance->global_lua_state, 0, 0, 0) != LUA_OK) + if (lua_pcall(my_instance->global_lua_state, 0, 0, 0)) { MXS_ERROR("luafilter: Global scope call to 'clientReply' failed: '%s'.", lua_tostring(my_session->lua_state, -1)); @@ -574,7 +574,7 @@ static int routeQuery(FILTER *instance, void *session, GWBUF *queue) lua_pushlstring(my_session->lua_state, fullquery, strlen(fullquery)); - if (lua_pcall(my_session->lua_state, 1, 1, 0) != LUA_OK) + if (lua_pcall(my_session->lua_state, 1, 1, 0)) { MXS_ERROR("luafilter: Session scope call to 'routeQuery' failed: '%s'.", lua_tostring(my_session->lua_state, -1)); @@ -606,7 +606,7 @@ static int routeQuery(FILTER *instance, void *session, GWBUF *queue) lua_pushlstring(my_instance->global_lua_state, fullquery, strlen(fullquery)); - if (lua_pcall(my_instance->global_lua_state, 1, 0, 0) != LUA_OK) + if (lua_pcall(my_instance->global_lua_state, 1, 0, 0)) { MXS_ERROR("luafilter: Global scope call to 'routeQuery' failed: '%s'.", lua_tostring(my_instance->global_lua_state, -1));