relayd: track the health quit pipe with the fd-tracker
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 26 Jun 2018 19:17:16 +0000 (15:17 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 3 Jul 2018 14:40:58 +0000 (10:40 -0400)
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-relayd/main.c

index fe2a01ffe1206ee9dcea41aa08eac1f5ac1e46b9..46c3cff5b5d63b752c6d5c345afebb73eccd41e0 100644 (file)
@@ -731,6 +731,17 @@ static int init_thread_quit_pipe(void)
                        "Quit pipe", thread_quit_pipe);
 }
 
+/*
+ * Init health quit pipe.
+ *
+ * Return -1 on error or 0 if all pipes are created.
+ */
+static int init_health_quit_pipe(void)
+{
+       return fd_tracker_util_pipe_open_cloexec(the_fd_tracker,
+                       "Health quit pipe", health_quit_pipe);
+}
+
 /*
  * Create a poll set with O_CLOEXEC and add the thread quit pipe to the set.
  */
@@ -4057,7 +4068,7 @@ int main(int argc, char **argv)
                goto exit_init_data;
        }
 
-       ret = utils_create_pipe(health_quit_pipe);
+       ret = init_health_quit_pipe();
        if (ret) {
                retval = -1;
                goto exit_health_quit_pipe;
@@ -4153,7 +4164,7 @@ exit_dispatcher_thread:
        }
 exit_health_thread:
 
-       utils_close_pipe(health_quit_pipe);
+       (void) fd_tracker_util_pipe_close(the_fd_tracker, health_quit_pipe);
 exit_health_quit_pipe:
 
 exit_init_data:
This page took 0.027752 seconds and 5 git commands to generate.