relayd: track the live_conn_pipe with the fd-tracker
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 27 Nov 2019 05:23:15 +0000 (00:23 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 30 Jan 2020 06:55:34 +0000 (01:55 -0500)
Create the relayd live connection pipe through the
fd_tracker_util_pipe_open_cloexec() function which wraps
utils_create_pipe_cloexec(), but tracks the resulting file descriptor.

The close of the pipe is also performed through the fd tracker.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I967c2fbecfb5dacfb8c41cad113604bad78dad65

src/bin/lttng-relayd/live.c

index 2a73556dffa0c22c33df136ee53eb39bcc5af362..fbc70303106e72bd3aefd8be55d985bbd0a8f229 100644 (file)
@@ -53,6 +53,7 @@
 #include <common/sessiond-comm/relayd.h>
 #include <common/uri.h>
 #include <common/utils.h>
+#include <common/fd-tracker/utils.h>
 
 #include "cmd.h"
 #include "live.h"
@@ -2315,7 +2316,7 @@ error_poll_create:
        lttng_ht_destroy(viewer_connections_ht);
 viewer_connections_ht_error:
        /* Close relay conn pipes */
-       utils_close_pipe(live_conn_pipe);
+       (void) fd_tracker_util_pipe_close(the_fd_tracker, live_conn_pipe);
        if (err) {
                DBG("Viewer worker thread exited with error");
        }
@@ -2339,7 +2340,8 @@ error_testpoint:
  */
 static int create_conn_pipe(void)
 {
-       return utils_create_pipe_cloexec(live_conn_pipe);
+       return fd_tracker_util_pipe_open_cloexec(the_fd_tracker,
+                       "Live connection pipe", live_conn_pipe);
 }
 
 int relayd_live_join(void)
This page took 0.034952 seconds and 4 git commands to generate.