From 48c4f28cde63c862229c41179e6fac606cdf41d4 Mon Sep 17 00:00:00 2001 From: David Goulet Date: Tue, 13 Dec 2011 15:50:16 -0500 Subject: [PATCH] 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 --- lttng-sessiond/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- 2.34.1