From: Jérémie Galarneau Date: Tue, 26 Nov 2019 22:08:52 +0000 (-0500) Subject: relayd: track the quit pipe with the fd-tracker X-Git-Tag: v2.12.0-rc1~63 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=6760999493e83d75539018eb9eed8f00f116ac12;p=lttng-tools.git relayd: track the quit pipe with the fd-tracker 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 --- 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); } /*