From 702f6d3d4ea172df0506e898b470b32b41340bde Mon Sep 17 00:00:00 2001 From: Dennis Schridde Date: Mon, 1 Oct 2012 22:54:52 +0200 Subject: [PATCH] Make register_inotify() a bit more obvious --- inotify.c | 1 - lsyncd.c | 8 ++++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/inotify.c b/inotify.c index dbb1335..0d3916c 100644 --- a/inotify.c +++ b/inotify.c @@ -351,7 +351,6 @@ inotify_ready(lua_State *L, struct observance *obs) extern void register_inotify(lua_State *L) { - lua_pushstring(L, "inotify"); luaL_register(L, "inotify", linotfylib); } diff --git a/lsyncd.c b/lsyncd.c index fa7813c..c0deb5a 100644 --- a/lsyncd.c +++ b/lsyncd.c @@ -1394,13 +1394,13 @@ register_lsyncd(lua_State *L) lua_settable(L, -3); lua_pop(L, 1); - lua_getglobal(L, "lsyncd"); #ifdef LSYNCD_WITH_INOTIFY - // TODO why is the here? + lua_getglobal(L, "lsyncd"); register_inotify(L); - lua_settable(L, -3); -#endif + lua_setfield(L, -2, "inotify"); lua_pop(L, 1); +#endif + if (lua_gettop(L)) { logstring("Error", "internal, stack not empty in lsyncd_register()"); exit(-1); // ERRNO