X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng-consumerd%2Fhealth-consumerd.c;h=dc8b32aa880d74b8685c16422917e430c1af2f70;hb=46440d0ccf65b098757389ffebb0f7452626c4a3;hp=1e2f31e488b51cb3f42af09adb299ea7448afac2;hpb=67fe4075e46a88aec59b8e49cbfd2670804ffa33;p=lttng-tools.git diff --git a/src/bin/lttng-consumerd/health-consumerd.c b/src/bin/lttng-consumerd/health-consumerd.c index 1e2f31e48..dc8b32aa8 100644 --- a/src/bin/lttng-consumerd/health-consumerd.c +++ b/src/bin/lttng-consumerd/health-consumerd.c @@ -184,8 +184,15 @@ void *thread_manage_health(void *data) is_root = !getuid(); if (is_root) { /* lttng health client socket path permissions */ - ret = chown(health_unix_sock_path, 0, - utils_get_group_id(tracing_group_name)); + gid_t gid; + + ret = utils_get_group_id(tracing_group_name, true, &gid); + if (ret) { + /* Default to root group. */ + gid = 0; + } + + ret = chown(health_unix_sock_path, 0, gid); if (ret < 0) { ERR("Unable to set group on %s", health_unix_sock_path); PERROR("chown"); @@ -259,11 +266,6 @@ 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) {