relayd: track the relay_conn_pipe with the fd-tracker
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 26 Nov 2019 22:07:41 +0000 (17:07 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 30 Jan 2020 06:55:34 +0000 (01:55 -0500)
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 <jeremie.galarneau@efficios.com>
Change-Id: I6ed0d64c973a454de2e50c7cae006fd546299290

src/bin/lttng-relayd/main.c

index 6234e3e170d92515d1255a15087906531369083a..43e60a48d78ebca51ff6378f20ffc818da494828 100644 (file)
@@ -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);
 }
 
 /*
This page took 0.026485 seconds and 4 git commands to generate.