X-Git-Url: https://git.enpas.org/?a=blobdiff_plain;f=util-src%2Fpposix.c;h=1b69852d2a703cacf2619adeffe821ad5ddb3b94;hb=925ed895e5048df72db313d7355d6f6766d8bdf8;hp=5288b08cd03217e8c86db35cfa0c16a20027817c;hpb=41977f3e683e553a2a96b23b467e2ac6b8c3cec3;p=prosody.git diff --git a/util-src/pposix.c b/util-src/pposix.c index 5288b08c..1b69852d 100644 --- a/util-src/pposix.c +++ b/util-src/pposix.c @@ -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 @@ -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");