X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=src%2Fbin%2Flttng-consumerd%2Fhealth-consumerd.c;h=1e2f31e488b51cb3f42af09adb299ea7448afac2;hb=67fe4075e46a88aec59b8e49cbfd2670804ffa33;hp=fc9a266653f2361efe3a4987bd2640e125761d8c;hpb=fd20dac985126e84929d657f5a1042222c7d5017;p=lttng-tools.git diff --git a/src/bin/lttng-consumerd/health-consumerd.c b/src/bin/lttng-consumerd/health-consumerd.c index fc9a26665..1e2f31e48 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 @@ -179,7 +177,7 @@ void *thread_manage_health(void *data) sock = lttcomm_create_unix_sock(health_unix_sock_path); if (sock < 0) { ERR("Unable to create health check Unix socket"); - ret = -1; + err = -1; goto error; } @@ -191,7 +189,7 @@ void *thread_manage_health(void *data) if (ret < 0) { ERR("Unable to set group on %s", health_unix_sock_path); PERROR("chown"); - ret = -1; + err = -1; goto error; } @@ -200,7 +198,7 @@ void *thread_manage_health(void *data) if (ret < 0) { ERR("Unable to set permissions on %s", health_unix_sock_path); PERROR("chmod"); - ret = -1; + err = -1; goto error; } } @@ -275,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; }