From: Gerrie Roos Date: Tue, 10 Jan 2012 07:00:42 +0000 (+0200) Subject: exec plugin: incorrectly exited select loop on signal. X-Git-Tag: collectd-4.10.6~3 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=adf8ddcdc19cf1670269bf8654eb72f5dce658f6;p=collectd.git exec plugin: incorrectly exited select loop on signal. Sometimes dead modules won't be started up correctly or running ones would not generate stats anymore. Problem manifests more often under load and on multicore hw Change-Id: Ifb70a74c0cd55fc421b65a1f4332147916eadb70 Signed-off-by: Florian Forster --- diff --git a/src/exec.c b/src/exec.c index 639b5d45..c48d85f5 100644 --- a/src/exec.c +++ b/src/exec.c @@ -580,10 +580,18 @@ static void *exec_read_one (void *arg) /* {{{ */ /* We use a copy of fdset, as select modifies it */ copy = fdset; - while (select(highest_fd + 1, ©, NULL, NULL, NULL ) > 0) + while (1) { int len; + status = select (highest_fd + 1, ©, NULL, NULL, NULL); + if (status < 0) + { + if (errno == EINTR) + continue; + break; + } + if (FD_ISSET(fd, ©)) { char *pnl;