From 6760999493e83d75539018eb9eed8f00f116ac12 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Tue, 26 Nov 2019 17:08:52 -0500 Subject: [PATCH] relayd: track the quit pipe with the fd-tracker MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Create the relayd quit 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: Ia2a000030765e8df990e0ea3d35a8bf157630d9f --- src/bin/lttng-relayd/main.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/bin/lttng-relayd/main.c b/src/bin/lttng-relayd/main.c index ed424d9dd..6234e3e17 100644 --- a/src/bin/lttng-relayd/main.c +++ b/src/bin/lttng-relayd/main.c @@ -64,6 +64,7 @@ #include #include #include +#include #include "backward-compatibility-group-by.h" #include "cmd.h" @@ -664,8 +665,10 @@ static void relayd_cleanup(void) } /* Close thread quit pipes */ utils_close_pipe(health_quit_pipe); - utils_close_pipe(thread_quit_pipe); - + if (thread_quit_pipe[0] != -1) { + (void) fd_tracker_util_pipe_close( + the_fd_tracker, thread_quit_pipe); + } if (sessiond_trace_chunk_registry) { sessiond_trace_chunk_registry_destroy( sessiond_trace_chunk_registry); @@ -835,11 +838,8 @@ void lttng_relay_notify_ready(void) */ static int init_thread_quit_pipe(void) { - int ret; - - ret = utils_create_pipe_cloexec(thread_quit_pipe); - - return ret; + return fd_tracker_util_pipe_open_cloexec( + the_fd_tracker, "Quit pipe", thread_quit_pipe); } /* -- 2.34.1