prosodyctl: check certs: Update messages to account for 'ssl' option maybe not existing
[prosody.git] / util-src / pposix.c
index 5288b08cd03217e8c86db35cfa0c16a20027817c..1b69852d2a703cacf2619adeffe821ad5ddb3b94 100644 (file)
@@ -35,8 +35,8 @@
 #include "lualib.h"
 #include "lauxlib.h"
 
-#if (LUA_VERSION_NUM == 502)
-#define luaL_register(L, N, R) luaL_setfuncs(L, R, 0)
+#if (LUA_VERSION_NUM == 501)
+#define luaL_setfuncs(L, R, N) luaL_register(L, NULL, R)
 #endif
 
 #include <fcntl.h>
@@ -642,6 +642,10 @@ int lc_uname(lua_State* L) {
        lua_setfield(L, -2, "version");
        lua_pushstring(L, uname_info.machine);
        lua_setfield(L, -2, "machine");
+#ifdef _GNU_SOURCE
+       lua_pushstring(L, uname_info.domainname);
+       lua_setfield(L, -2, "domainname");
+#endif
        return 1;
 }
 
@@ -803,7 +807,7 @@ int luaopen_util_pposix(lua_State* L) {
        };
 
        lua_newtable(L);
-       luaL_register(L, NULL,  exports);
+       luaL_setfuncs(L, exports, 0);
 
        lua_pushliteral(L, "pposix");
        lua_setfield(L, -2, "_NAME");