From: Jérémie Galarneau Date: Wed, 27 Nov 2019 05:23:15 +0000 (-0500) Subject: relayd: track the live_conn_pipe with the fd-tracker X-Git-Tag: v2.12.0-rc1~57 X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=commitdiff_plain;h=87bcbe91a9b75f0c6240f01105cfa00fb0b4d052 relayd: track the live_conn_pipe with the fd-tracker 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 --- 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)