From: Jérémie Galarneau Date: Tue, 26 Nov 2019 22:07:41 +0000 (-0500) Subject: relayd: track the relay_conn_pipe with the fd-tracker X-Git-Tag: v2.12.0-rc1~62 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=726b23964ab6fc7d77a3ced3c416ebffbcc2d3ac;p=lttng-tools.git relayd: track the relay_conn_pipe with the fd-tracker Create the relayd 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: I6ed0d64c973a454de2e50c7cae006fd546299290 --- diff --git a/src/bin/lttng-relayd/main.c b/src/bin/lttng-relayd/main.c index 6234e3e17..43e60a48d 100644 --- a/src/bin/lttng-relayd/main.c +++ b/src/bin/lttng-relayd/main.c @@ -3947,7 +3947,8 @@ error_poll_create: lttng_ht_destroy(relay_connections_ht); relay_connections_ht_error: /* Close relay conn pipes */ - utils_close_pipe(relay_conn_pipe); + (void) fd_tracker_util_pipe_close(the_fd_tracker, + relay_conn_pipe); if (err) { DBG("Thread exited with error"); } @@ -3969,11 +3970,8 @@ error_testpoint: */ static int create_relay_conn_pipe(void) { - int ret; - - ret = utils_create_pipe_cloexec(relay_conn_pipe); - - return ret; + return fd_tracker_util_pipe_open_cloexec(the_fd_tracker, + "Relayd connection pipe", relay_conn_pipe); } /*