This commit is contained in:
Axel Kittenberger 2010-10-25 21:41:45 +00:00
parent b41c2847ab
commit 0bf3e14cec
3 changed files with 11 additions and 10 deletions

View File

@ -9,8 +9,6 @@ settings = {
loglevel = DEBUG,
}
print(bla)
------
-- for testing purposes
--

View File

@ -1099,15 +1099,16 @@ main(int argc, char *argv[])
/* initialize */
/* lua code will set configuration and add watches */
{
ind idx = 0;
int idx = 1;
/* creates a table with all option arguments */
lua_newtable(L);
lua_pushnumber(L, idx++);
lua_pushstring(L, argv[argp++]);
lua_settable(L, -3);
lua_getglobal(L, "lsyncd_initialize");
lua_call(L, 0, 0);
lua_newtable(L);
while(argp < argc) {
lua_pushnumber(L, idx++);
lua_pushstring(L, argv[argp++]);
lua_settable(L, -3);
}
lua_call(L, 1, 0);
}
masterloop(L);

View File

@ -426,10 +426,12 @@ end
----
-- Called from core on init or restart after user configuration.
--
function lsyncd_initialize()
function lsyncd_initialize(args)
-- From this point on, no globals may be created anymore
GLOBAL_lock(_G)
print(table.concat(args))
-- makes sure the user gave lsyncd anything to do
if #origins == 0 then
log(ERROR, "nothing to watch. Use directory(SOURCEDIR, TARGET) in your config file.");