X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=lttng-sessiond%2Fmain.c;h=27d4c04de9314d08dbdd530752b7dd457c1c684b;hp=54859c8dc302883eccb9dc3c53563ab4eda7f89c;hb=b9ef1c833d0a0dbb457ca920a15c0f54f3585374;hpb=9bb127554f24d6157eba95a22a39df503ad2ea5c diff --git a/lttng-sessiond/main.c b/lttng-sessiond/main.c index 54859c8dc..27d4c04de 100644 --- a/lttng-sessiond/main.c +++ b/lttng-sessiond/main.c @@ -2772,8 +2772,11 @@ static int cmd_start_trace(struct ltt_session *session) ksession = session->kernel_session; usess = session->ust_session; - if (session->enabled) - return LTTCOMM_UST_START_FAIL; + if (session->enabled) { + ret = LTTCOMM_UST_START_FAIL; + goto error; + } + session->enabled = 1; /* Kernel tracing */ @@ -2861,8 +2864,11 @@ static int cmd_stop_trace(struct ltt_session *session) ksession = session->kernel_session; usess = session->ust_session; - if (!session->enabled) - return LTTCOMM_UST_START_FAIL; + if (!session->enabled) { + ret = LTTCOMM_UST_START_FAIL; + goto error; + } + session->enabled = 0; /* Kernel tracer */