Fix register consumer fd test on registration
authorDavid Goulet <david.goulet@polymtl.ca>
Tue, 13 Dec 2011 20:50:16 +0000 (15:50 -0500)
committerDavid Goulet <david.goulet@polymtl.ca>
Tue, 13 Dec 2011 20:50:16 +0000 (15:50 -0500)
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 <julien.desfossez@polymtl.ca>
Signed-off-by: David Goulet <david.goulet@polymtl.ca>
lttng-sessiond/main.c

index 27d4c04de9314d08dbdd530752b7dd457c1c684b..262f48b8ab3b0ffc717814e9ec80e3477ee2df40 100644 (file)
@@ -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;
                }
This page took 0.02773 seconds and 4 git commands to generate.