From eadbb6a202d9211d31c4152c19417ba28131b626 Mon Sep 17 00:00:00 2001 From: Axel Kittenberger Date: Thu, 11 Nov 2010 20:43:20 +0000 Subject: [PATCH] --- lsyncd.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lsyncd.c b/lsyncd.c index 878640b..d704b4d 100644 --- a/lsyncd.c +++ b/lsyncd.c @@ -859,7 +859,8 @@ static int callError; * Prior it pushed the callError handler. */ static void -load_runner_func(lua_State *L, const char *name) +load_runner_func(lua_State *L, + const char *name) { printlogf(L, "Call", "%s()", name); @@ -1084,8 +1085,9 @@ masterloop(lua_State *L) /* kernel > 2.6.21 indicates that way that way that * the buffer was too small to fit a filename. * double its size and try again. When using a lower - * kernel and a filename > 2KB appears lsyncd - * will fail. (but does a 2KB filename really happen?)*/ + * kernel and a filename > 2KB appears lsyncd + * will fail. (but does a 2KB filename really happen?) + */ readbuf_size *= 2; readbuf = s_realloc(readbuf, readbuf_size); continue; @@ -1374,7 +1376,7 @@ main(int argc, char *argv[]) } /* opens inotify */ - inotify_fd = inotify_init(); + inotify_fd = inotify_init1(IN_CLOEXEC); if (inotify_fd == -1) { printlogf(L, "Error", "Cannot create inotify instance! (%d:%s)", @@ -1382,6 +1384,7 @@ main(int argc, char *argv[]) return -1; // ERRNO } + { /* adds signal handlers * * listens to SIGCHLD, but blocks it until pselect()