]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Restore Lua 5.2 compatibility
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 1 Apr 2019 11:44:42 +0000 (12:44 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 1 Apr 2019 11:44:42 +0000 (12:44 +0100)
Issue: #2826
Closes: #2826
src/lua/lua_thread_pool.c
test/rspamd_lua_pcall_vs_resume_test.c

index d10f64579aabbc01dce3902d1c7f7697fd05180d..3d289a12eba8cdd5c624b9a60d920222a403724b 100644 (file)
@@ -236,7 +236,7 @@ static gint
 lua_do_resume_full (lua_State *L, gint narg, const gchar *loc)
 {
        msg_debug_lua_threads ("%s: lua_do_resume_full", loc);
-#if LUA_VERSION_NUM < 503
+#if LUA_VERSION_NUM < 502
        return lua_resume (L, narg);
 #else
        return lua_resume (L, NULL, narg);
index 8252dffb0956981cd312961e6f02d6925fe55716..6cb05fd383edda61d8c3a67e65dee7e9b4d1c218 100644 (file)
@@ -53,7 +53,7 @@ test_resume(lua_State *L, gint function_call)
 
        for (i = 0; i < N; i ++) {
                lua_rawgeti (L, LUA_REGISTRYINDEX, function_call);
-#if LUA_VERSION_NUM < 503
+#if LUA_VERSION_NUM < 502
                lua_resume (L, 0);
 #else
                lua_resume (L, NULL, 0);
@@ -79,7 +79,7 @@ test_resume_get_thread(gint function_call)
                ent = lua_thread_pool_get_for_config (rspamd_main->cfg);
 
                lua_rawgeti (ent->lua_state, LUA_REGISTRYINDEX, function_call);
-#if LUA_VERSION_NUM < 503
+#if LUA_VERSION_NUM < 502
                lua_resume (ent->lua_state, 0);
 #else
                lua_resume (ent->lua_state, NULL, 0);
@@ -107,7 +107,7 @@ test_resume_get_new_thread(gint function_call)
                ent = lua_thread_pool_get_for_task (rspamd_main->cfg->lua_thread_pool);
 
                lua_rawgeti (ent->lua_state, LUA_REGISTRYINDEX, function_call);
-#if LUA_VERSION_NUM < 503
+#if LUA_VERSION_NUM < 502
                lua_resume (ent->lua_state, 0);
 #else
                lua_resume (ent->lua_state, NULL, 0);