From: David Goulet Date: Tue, 13 Dec 2011 20:50:16 +0000 (-0500) Subject: Fix register consumer fd test on registration X-Git-Tag: v2.0-pre15~3 X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=commitdiff_plain;h=48c4f28cde63c862229c41179e6fac606cdf41d4 Fix register consumer fd test on registration When a kernel session is created, a consumer is immediately spawned. So, using two sessions, the second one was not able to register it's own consumer since the consumer_fd is set because there is a running kernel consumer from the first created session. The flag consumer_fds_sent is now used to test if the kernel consumer is already consuming buffers. Reported-by: Julien Desfossez Signed-off-by: David Goulet --- diff --git a/lttng-sessiond/main.c b/lttng-sessiond/main.c index 27d4c04de..262f48b8a 100644 --- a/lttng-sessiond/main.c +++ b/lttng-sessiond/main.c @@ -3000,7 +3000,7 @@ static int cmd_register_consumer(struct ltt_session *session, int domain, switch (domain) { case LTTNG_DOMAIN_KERNEL: /* Can't register a consumer if there is already one */ - if (session->kernel_session->consumer_fd != 0) { + if (session->kernel_session->consumer_fds_sent != 0) { ret = LTTCOMM_KERN_CONSUMER_FAIL; goto error; }