From 4ddbb903fa9ab57bdf7901c199bbe872c22c7be5 Mon Sep 17 00:00:00 2001 From: Axel Kittenberger Date: Tue, 3 Aug 2010 15:19:28 +0000 Subject: [PATCH] dont complain about read() failing in case of being killed. --- lsyncd.c | 12 ++++++++---- tests/directorymv.sh | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/lsyncd.c b/lsyncd.c index 8a2ee2b..54afcbe 100644 --- a/lsyncd.c +++ b/lsyncd.c @@ -1552,7 +1552,11 @@ master_loop(const struct global_options *opts, } if (len < 0) { - printlogf(log, ERROR, "failed to read from inotify (%d:%s)", errno, strerror(errno)); + if (!keep_going) { + printlogf(log, NORMAL, "read exited due to TERM signal."); + } else { + printlogf(log, ERROR, "failed to read from inotify (%d:%s)", errno, strerror(errno)); + } return false; } @@ -1581,7 +1585,8 @@ master_loop(const struct global_options *opts, } /** - * Utility function to check file exists. Print out error message and die. + * Utility function to check file exists. + * Prints out error message and die. * * @param filename filename to check */ @@ -1595,7 +1600,6 @@ check_file_exists(const struct log* log, const char* filename, const char *errms } } - /** * Utility function to check given path is absolute path. * @@ -1672,7 +1676,7 @@ print_help(char *arg0) #ifdef XML_CONFIG /*--------------------------------------------------------------------------* - * config file parsing + * Config file parsing *--------------------------------------------------------------------------*/ /** diff --git a/tests/directorymv.sh b/tests/directorymv.sh index d4862df..7c12090 100755 --- a/tests/directorymv.sh +++ b/tests/directorymv.sh @@ -40,7 +40,7 @@ echo -e "$CON* and deleting a directory$COFF" rm -r "${WORKSOURCE}"/b echo -e "$CON* waiting for lsyncd to do the job.$COFF" -sleep 10s +sleep 20s echo -e "$CON* killing daemon$COFF" if ! kill "${LSYNCPID}"; then