From 03ddfb9a69a4740ccd6f8352c6f9896a29bf6e0c Mon Sep 17 00:00:00 2001 From: Kienan Stewart Date: Thu, 28 Nov 2024 15:25:28 -0500 Subject: [PATCH] Clean-up: sessiond: Replace `exit()` with `return` MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Use `return` to avoid running into issues in the future when using `lttng::scope_exit` objects to perform clean-up. Change-Id: Id4e4250c7f34355b953702ff8353300acca98ac8 Signed-off-by: Kienan Stewart Signed-off-by: Jérémie Galarneau --- src/bin/lttng-sessiond/main.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/bin/lttng-sessiond/main.cpp b/src/bin/lttng-sessiond/main.cpp index a7920a541..ac53c6b29 100644 --- a/src/bin/lttng-sessiond/main.cpp +++ b/src/bin/lttng-sessiond/main.cpp @@ -437,7 +437,7 @@ static int set_option(int opt, const char *arg, const char *optname) ERR("Cannot show --help for `lttng-sessiond`"); perror("exec"); } - exit(ret ? EXIT_FAILURE : EXIT_SUCCESS); + return ret ? EXIT_FAILURE : EXIT_SUCCESS; } else if (string_match(optname, "version") || opt == 'V') { opt_print_version = 1; } else if (string_match(optname, "sig-parent") || opt == 'S') { @@ -2074,9 +2074,9 @@ exit_options: exit_set_signal_handler: if (!retval) { - exit(EXIT_SUCCESS); + return EXIT_SUCCESS; } else { - exit(EXIT_FAILURE); + return EXIT_FAILURE; } } -- 2.39.5