From 87bcbe91a9b75f0c6240f01105cfa00fb0b4d052 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Wed, 27 Nov 2019 00:23:15 -0500 Subject: [PATCH] relayd: track the live_conn_pipe with the fd-tracker MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Change-Id: I967c2fbecfb5dacfb8c41cad113604bad78dad65 --- src/bin/lttng-relayd/live.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/bin/lttng-relayd/live.c b/src/bin/lttng-relayd/live.c index 2a73556df..fbc703031 100644 --- a/src/bin/lttng-relayd/live.c +++ b/src/bin/lttng-relayd/live.c @@ -53,6 +53,7 @@ #include #include #include +#include #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) -- 2.34.1