Use `return` to avoid running into issues in the future when using
`lttng::scope_exit` objects to perform clean-up.
Change-Id: I11d9585a2e3fb5c5453220a07c29f166016d46b9
Signed-off-by: Kienan Stewart <kstewart@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
if (ret) {
ERR("Cannot show --help for `lttng-crash`");
perror("exec");
- exit(EXIT_FAILURE);
}
}
if (argc < 2) {
usage();
- exit(EXIT_FAILURE);
+ return -1;
}
while ((opt = getopt_long(argc, argv, "+Vhve:x:", long_options, nullptr)) != -1) {
ret = spawn_viewer(trace_path, viewer_path, false);
if (ret) {
- exit(EXIT_FAILURE);
+ return EXIT_FAILURE;
}
/* Never reached */
- exit(EXIT_SUCCESS);
+ return EXIT_SUCCESS;
}
return 0;
}
}
}
end:
- exit(has_warning ? EXIT_FAILURE : EXIT_SUCCESS);
+ return has_warning ? EXIT_FAILURE : EXIT_SUCCESS;
}