Add UST namespace contexts
[lttng-tools.git] / src / bin / lttng-sessiond / health.c
index e8c42e4bd7fa6f2b8b7394e9af43461be4b26fb4..9ff6bd1ae1013d9b86e5e178f920ff7286e63114 100644 (file)
@@ -95,8 +95,15 @@ static void *thread_manage_health(void *data)
 
        if (is_root) {
                /* lttng health client socket path permissions */
-               ret = chown(config.health_unix_sock_path.value, 0,
-                               utils_get_group_id(config.tracing_group_name.value));
+               gid_t gid;
+
+               ret = utils_get_group_id(config.tracing_group_name.value, true, &gid);
+               if (ret) {
+                       /* Default to root group. */
+                       gid = 0;
+               }
+
+               ret = chown(config.health_unix_sock_path.value, 0, gid);
                if (ret < 0) {
                        ERR("Unable to set group on %s", config.health_unix_sock_path.value);
                        PERROR("chown");
@@ -158,11 +165,6 @@ restart:
                        revents = LTTNG_POLL_GETEV(&events, i);
                        pollfd = LTTNG_POLL_GETFD(&events, i);
 
-                       if (!revents) {
-                               /* No activity for this FD (poll implementation). */
-                               continue;
-                       }
-
                        /* Event on the registration socket */
                        if (pollfd == sock) {
                                if (revents & LPOLLIN) {
@@ -265,7 +267,7 @@ bool launch_health_management_thread(void)
 
        notifiers = zmalloc(sizeof(*notifiers));
        if (!notifiers) {
-               goto error;
+               goto error_alloc;
        }
 
        sem_init(&notifiers->ready, 0, 0);
@@ -287,5 +289,6 @@ bool launch_health_management_thread(void)
        return true;
 error:
        cleanup_health_management_thread(notifiers);
+error_alloc:
        return false;
 }
This page took 0.025866 seconds and 4 git commands to generate.