Fix: segfault on create session with two URLs
authorDavid Goulet <dgoulet@efficios.com>
Mon, 22 Oct 2012 19:32:34 +0000 (15:32 -0400)
committerDavid Goulet <dgoulet@efficios.com>
Mon, 22 Oct 2012 19:32:34 +0000 (15:32 -0400)
https://bugs.lttng.org/issues/350

Fixes #350

Signed-off-by: David Goulet <dgoulet@efficios.com>
src/bin/lttng-sessiond/cmd.c
src/lib/lttng-ctl/lttng-ctl.c

index 1d4f9264eb0a57e4aedfa595767b1478b9402a4f..f72d4bb17a3c353a31b4f55ac49aaedc87744eef 100644 (file)
@@ -1528,11 +1528,6 @@ int cmd_set_consumer_uri(int domain, struct ltt_session *session,
                goto error;
        }
 
-       if (!session->start_consumer) {
-               ret = LTTNG_ERR_NO_CONSUMER;
-               goto error;
-       }
-
        /*
         * This case switch makes sure the domain session has a temporary consumer
         * so the URL can be set.
@@ -2142,11 +2137,6 @@ int cmd_enable_consumer(int domain, struct ltt_session *session)
                goto error;
        }
 
-       if (!session->start_consumer) {
-               ret = LTTNG_ERR_NO_CONSUMER;
-               goto error;
-       }
-
        switch (domain) {
        case 0:
                assert(session->consumer);
@@ -2320,6 +2310,8 @@ int cmd_enable_consumer(int domain, struct ltt_session *session)
                break;
        }
 
+       session->start_consumer = 1;
+
        /* Enable it */
        if (consumer) {
                consumer->enabled = 1;
index 67c5972191016d8eafbf74d1e34faea0e8221e7f..cc69dd5c23cdf8b39433653220d3a8c655961888 100644 (file)
@@ -1625,7 +1625,7 @@ int _lttng_create_session_ext(const char *name, const char *url,
 
        lsm.u.uri.size = size;
 
-       if (uris[0].dtype != LTTNG_DST_PATH && strlen(uris[0].subdir) == 0) {
+       if (size > 0 && uris[0].dtype != LTTNG_DST_PATH && strlen(uris[0].subdir) == 0) {
                ret = snprintf(uris[0].subdir, sizeof(uris[0].subdir), "%s-%s", name,
                                datetime);
                if (ret < 0) {
This page took 0.042106 seconds and 4 git commands to generate.