From c04077180977834684b367f97afa22a79fcbd471 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Fri, 22 Nov 2019 19:20:22 -0500 Subject: [PATCH] relayd: close stdin on launch MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The relay daemon has no use for the standard input; it can be safely closed early on launch. Signed-off-by: Jérémie Galarneau --- src/bin/lttng-relayd/main.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/bin/lttng-relayd/main.c b/src/bin/lttng-relayd/main.c index 325be9cf1..6e5b612f2 100644 --- a/src/bin/lttng-relayd/main.c +++ b/src/bin/lttng-relayd/main.c @@ -3800,6 +3800,12 @@ int main(int argc, char **argv) goto exit_options; } + ret = fclose(stdin); + if (ret) { + PERROR("Failed to close stdin"); + goto exit_options; + } + /* Try to create directory if -o, --output is specified. */ if (opt_output_path) { if (*opt_output_path != '/') { -- 2.34.1