X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=src%2Fbin%2Flttng-consumerd%2Fhealth-consumerd.c;h=2ea6303f77533fd28bf9684598733bdf4f8cf9c9;hb=40063ead9b2f76ae2b442fcca98bb5b50ab9d2a1;hp=bd47f0c497c042c5ec247f8537a62822f89938e4;hpb=6c1c0768320135c6936c371b09731851b508c023;p=lttng-tools.git diff --git a/src/bin/lttng-consumerd/health-consumerd.c b/src/bin/lttng-consumerd/health-consumerd.c index bd47f0c49..2ea6303f7 100644 --- a/src/bin/lttng-consumerd/health-consumerd.c +++ b/src/bin/lttng-consumerd/health-consumerd.c @@ -15,7 +15,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#define _GNU_SOURCE #define _LGPL_SOURCE #include #include @@ -37,15 +36,14 @@ #include #include #include -#include #include #include #include #include #include -#include -#include +#include +#include #include #include #include @@ -261,6 +259,11 @@ restart: revents = LTTNG_POLL_GETEV(&events, i); pollfd = LTTNG_POLL_GETFD(&events, i); + if (!revents) { + /* No activity for this FD (poll implementation). */ + continue; + } + /* Thread quit pipe has been closed. Killing thread. */ ret = check_health_quit_pipe(pollfd, revents); if (ret) { @@ -270,7 +273,8 @@ restart: /* Event on the registration socket */ if (pollfd == sock) { - if (revents & (LPOLLERR | LPOLLHUP | LPOLLRDHUP)) { + if (revents & (LPOLLERR | LPOLLHUP | LPOLLRDHUP) + && !(revents & LPOLLIN)) { ERR("Health socket poll error"); goto error; }