From: Kienan Stewart Date: Thu, 28 Nov 2024 20:25:28 +0000 (-0500) Subject: Clean-up: sessiond: Replace `exit()` with `return` X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=03ddfb9a69a4740ccd6f8352c6f9896a29bf6e0c;p=lttng-tools.git Clean-up: sessiond: Replace `exit()` with `return` 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 --- 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; } }