Extend the rotation API to provide network trace archive locations
[lttng-tools.git] / src / bin / lttng-relayd / health-relayd.c
index 10a0e5fdffe1b88ab4ae144dcfff87f381b38b1a..ba996621b0058ca62f94a7d1c4b001a5737b1b2e 100644 (file)
 #include <sys/mman.h>
 #include <assert.h>
 #include <urcu/compiler.h>
-#include <ulimit.h>
 #include <inttypes.h>
 
 #include <common/defaults.h>
 #include <common/common.h>
-#include <common/consumer.h>
-#include <common/consumer-timer.h>
+#include <common/consumer/consumer.h>
+#include <common/consumer/consumer-timer.h>
 #include <common/compat/poll.h>
 #include <common/sessiond-comm/sessiond-comm.h>
 #include <common/utils.h>
@@ -207,7 +206,7 @@ int setup_health_path(void)
                }
                snprintf(health_unix_sock_path, sizeof(health_unix_sock_path),
                        DEFAULT_GLOBAL_RELAY_HEALTH_UNIX_SOCK,
-                       getpid());
+                       (int) getpid());
        } else {
                /* Set health check Unix path */
                if (strlen(health_unix_sock_path) != 0) {
@@ -216,7 +215,7 @@ int setup_health_path(void)
 
                snprintf(health_unix_sock_path, sizeof(health_unix_sock_path),
                        DEFAULT_HOME_RELAY_HEALTH_UNIX_SOCK,
-                       home_path, getpid());
+                       home_path, (int) getpid());
        }
 
 end:
@@ -250,7 +249,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;
        }
 
@@ -262,7 +261,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;
                }
 
@@ -271,7 +270,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;
                }
        }
@@ -409,8 +408,9 @@ restart:
                new_sock = -1;
        }
 
-exit:
 error:
+       lttng_relay_stop_threads();
+exit:
        if (err) {
                ERR("Health error occurred in %s", __func__);
        }
This page took 0.024439 seconds and 4 git commands to generate.