relayd: close stdin on launch
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Sat, 23 Nov 2019 00:20:22 +0000 (19:20 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Sat, 23 Nov 2019 00:30:25 +0000 (19:30 -0500)
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 <jeremie.galarneau@efficios.com>
src/bin/lttng-relayd/main.c

index 325be9cf124df7d495fd3a27863195bebb9c55c4..6e5b612f21ae0cc72619a4b2c8ebbeb1d9367467 100644 (file)
@@ -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 != '/') {
This page took 0.028257 seconds and 5 git commands to generate.