kumquat-buildroot/package/luasyslog/0001-compat-Lua-5.3.patch

53 lines
1.2 KiB
Diff
Raw Normal View History

From b3347655bd31c4f1fd9e101787a84da0c98f2f8f Mon Sep 17 00:00:00 2001
From: Francois Perrad <francois.perrad@gadz.org>
Date: Wed, 12 Jun 2019 20:47:18 +0200
Subject: [PATCH] compat Lua 5.3
Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
---
lsyslog.c | 8 ++++++--
syslog.lua | 4 ++--
2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/luasyslog-1.0.0/lsyslog.c b/luasyslog-1.0.0/lsyslog.c
index cd512dc..57121da 100644
--- a/luasyslog-1.0.0/lsyslog.c
+++ b/luasyslog-1.0.0/lsyslog.c
@@ -136,7 +136,7 @@
lua_settable(L, -3);
}
-static const struct luaL_reg lsysloglib[] =
+static const struct luaL_Reg lsysloglib[] =
{
{"open", lsyslog_open},
{"close", lsyslog_close},
@@ -146,7 +146,11 @@
int luaopen_lsyslog(lua_State *L)
{
- luaL_openlib(L, "lsyslog", lsysloglib, 0);
+#if LUA_VERSION_NUM >= 502
+ luaL_newlib(L, lsysloglib);
+#else
+ luaL_register(L, "lsyslog", lsysloglib);
+#endif
set_info(L);
return 1;
diff --git a/luasyslog-1.0.0/syslog.lua b/luasyslog-1.0.0/syslog.lua
index febda00..f4d98ec 100644
--- a/luasyslog-1.0.0/syslog.lua
+++ b/luasyslog-1.0.0/syslog.lua
@@ -1,5 +1,5 @@
-require"logging"
-require"lsyslog"
+local logging = require"logging"
+local lsyslog = require"lsyslog"
local convert =
{
--
2.20.1