#include "kernel.h"
#include "kernel-consumer.h"
#include "shm.h"
-#include "ust-ctl.h"
+#include "lttng-ust-ctl.h"
#include "ust-consumer.h"
#include "utils.h"
#include "fd-limit.h"
const char *progname;
static int lockfile_fd = -1;
+static int opt_print_version;
/* Set to 1 when a SIGUSR1 signal is received. */
static int recv_child_signal;
}
exit(ret ? EXIT_FAILURE : EXIT_SUCCESS);
} else if (string_match(optname, "version") || opt == 'V') {
- fprintf(stdout, "%s\n", VERSION);
- exit(EXIT_SUCCESS);
+ opt_print_version = 1;
} else if (string_match(optname, "sig-parent") || opt == 'S') {
config.sig_parent = true;
} else if (string_match(optname, "kconsumerd-err-sock")) {
return ret;
}
+static void print_version(void) {
+ fprintf(stdout, "%s\n", VERSION);
+}
+
/*
* daemon configuration loading and argument parsing
*/
sessiond_config_log(&config);
sessiond_uuid_log();
+ if (opt_print_version) {
+ print_version();
+ retval = 0;
+ goto exit_options;
+ }
+
if (create_lttng_rundir()) {
retval = -1;
goto exit_options;