aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt2
-rw-r--r--degesch.c9
2 files changed, 9 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index bf41327..7f5ee6b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -85,7 +85,7 @@ include_directories (${libffi_INCLUDE_DIRS})
link_directories (${libffi_LIBRARY_DIRS})
# FIXME: other Lua versions may be acceptable, don't know yet
-pkg_search_module (lua lua53 lua5.3 lua-5.3 lua>=5.3)
+pkg_search_module (lua lua53 lua5.3 lua-5.3 lua54 lua5.4 lua-5.4 lua>=5.3)
option (WITH_LUA "Enable support for Lua plugins" ${lua_FOUND})
if (WITH_LUA)
diff --git a/degesch.c b/degesch.c
index 5afd49c..5ba7a42 100644
--- a/degesch.c
+++ b/degesch.c
@@ -9646,12 +9646,19 @@ lua_task_resume (struct lua_task *self, int index)
n = 2;
}
+#if LUA_VERSION_NUM >= 504
+ int nresults = 0;
+ int res = lua_resume (L, NULL, n, &nresults);
+#else
int res = lua_resume (L, NULL, n);
+ int nresults = lua_gettop (L);
+#endif
+
struct error *error = NULL;
if (res == LUA_YIELD)
{
// AFAIK we don't get any good error context information from here
- if (lua_task_schedule (self, lua_gettop (L), &error))
+ if (lua_task_schedule (self, nresults, &error))
return;
}
// For simplicity ignore any results from successful returns