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;
}
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");
- ret = -1;
+ err = -1;
goto error;
}
if (ret < 0) {
ERR("Unable to set permissions on %s", health_unix_sock_path);
PERROR("chmod");
- ret = -1;
+ err = -1;
goto error;
}
}
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) {