diff options
author | Christian Pointner <equinox@helsinki.at> | 2011-03-30 02:46:42 (GMT) |
---|---|---|
committer | Christian Pointner <equinox@helsinki.at> | 2011-03-30 02:46:42 (GMT) |
commit | 50bdc20f9024216de8f6cb45756ca54ffec42a5d (patch) | |
tree | be4ab5d0870105aa79e5f89ba5dcc076724114de /rhnop-server/nopsyncd.c | |
parent | 97ea5eee07f939f03a87c2d8df1c996ef38ca4b2 (diff) |
added libdir handling
Diffstat (limited to 'rhnop-server/nopsyncd.c')
-rw-r--r-- | rhnop-server/nopsyncd.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/rhnop-server/nopsyncd.c b/rhnop-server/nopsyncd.c index 63bef7f..acb1eb1 100644 --- a/rhnop-server/nopsyncd.c +++ b/rhnop-server/nopsyncd.c @@ -30,8 +30,11 @@ #include <lauxlib.h> #include "l_pipe.h" +#include "config.h" #define LUA_MAIN_LOOP_FUNC "main_loop" +#define QLISTENER LIBDIR"/qlistener.lua" +#define TCPSERVER LIBDIR"/tcpserver.lua" static const luaL_Reg nopsyncd_lualibs[] = { {"", luaopen_base}, @@ -66,6 +69,9 @@ int init_main_loop(lua_State *L, const char* filename) return -1; } + lua_pushstring(L, LIBDIR); + lua_setglobal(L, "rhnoplibdir"); + ret = lua_pcall(L, 0, 0, 0); if(ret) { const char* err_str = luaL_checkstring(L, -1); @@ -143,14 +149,14 @@ int main(int argc, char* argv[]) return 1; } - ret = pthread_create(&qlistener, NULL, main_loop, "qlistener.lua"); + ret = pthread_create(&qlistener, NULL, main_loop, QLISTENER); if(ret) { fprintf(stderr, "Error creating qlistener thread (code: %d)\n", ret); return 1; } pthread_detach(qlistener); /* can't kill this thread so don't join to it */ - ret = pthread_create(&tcpserver, NULL, main_loop, "tcpserver.lua"); + ret = pthread_create(&tcpserver, NULL, main_loop, TCPSERVER); if(ret) { fprintf(stderr, "Error creating qlistener thread (code: %d)\n", ret); return 1; |