From 0ff894eee9c8fd622821ea5ae9b665afb12854d6 Mon Sep 17 00:00:00 2001 From: Axel Kittenberger Date: Sat, 23 Oct 2010 19:19:46 +0000 Subject: [PATCH] --- lsyncd.c | 14 ++++++++++++++ lsyncd.lua | 1 + 2 files changed, 15 insertions(+) diff --git a/lsyncd.c b/lsyncd.c index de03b97..18cbba7 100644 --- a/lsyncd.c +++ b/lsyncd.c @@ -907,6 +907,20 @@ masterloop(lua_State *L) handle_event(L, NULL); } + /* collect zombified child processes */ + while(1) { + pid_t pid = waitpid(0, &status, WNOHANG); + int status; + + if (pid <= 0) { + break; + } + lua_getglobal(L, "lsyncd_collect_child"); + lua_pushinteger(L, pid); + lua_pushinteger(L, WEXITSTATUS(status)); + lua_call(L, 2, 0); + } + /* let the runner spawn child processes */ lua_getglobal(L, "lsyncd_alarm"); lua_pushinteger(L, times(NULL)); diff --git a/lsyncd.lua b/lsyncd.lua index 37e9d25..1a5b452 100644 --- a/lsyncd.lua +++ b/lsyncd.lua @@ -54,6 +54,7 @@ local origins = {} -- .filename .. filename or nil (=dir itself) -- (.movepeer) .. for MOVEFROM/MOVETO link to other delay -- } +- -- } -- local targets = {}