From: Jérémie Galarneau Date: Tue, 18 Feb 2020 00:46:18 +0000 (-0500) Subject: Fix: relayd: live: unchecked poll set creation return value X-Git-Tag: v2.12.0-rc2~61 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=ca0763c43012215c13569b75a0b5fd1e22fb8aa9;p=lttng-tools.git Fix: relayd: live: unchecked poll set creation return value The fd_tracker_util_poll_create function can fail because of fd exhaustion or because the underlying epoll call fails. In both cases, report and handle the error. Signed-off-by: Jérémie Galarneau Change-Id: Ie79fdc011afda43395ac883c6648f983118cfddb --- diff --git a/src/bin/lttng-relayd/live.c b/src/bin/lttng-relayd/live.c index 3ddafe2a1..06cfa5c7b 100644 --- a/src/bin/lttng-relayd/live.c +++ b/src/bin/lttng-relayd/live.c @@ -439,6 +439,10 @@ int create_named_thread_poll_set(struct lttng_poll_event *events, ret = fd_tracker_util_poll_create(the_fd_tracker, name, events, 1, LTTNG_CLOEXEC); + if (ret) { + PERROR("Failed to create \"%s\" poll file descriptor", name); + goto error; + } /* Add quit pipe */ ret = lttng_poll_add(events, thread_quit_pipe[0], LPOLLIN | LPOLLERR);