]> git.lttng.org Git - lttng-tools.git/commitdiff
Clean-up: sessiond: Replace `exit()` with `return`
authorKienan Stewart <kstewart@efficios.com>
Thu, 28 Nov 2024 20:25:28 +0000 (15:25 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 18 Dec 2024 15:56:19 +0000 (15:56 +0000)
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 <kstewart@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-sessiond/main.cpp

index a7920a541ef583f904337e735b061f53d2c8fb5e..ac53c6b290db10b3e57e0e01a37cc5cf0af8899b 100644 (file)
@@ -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;
        }
 }
 
This page took 0.029714 seconds and 4 git commands to generate.