Fix RCU-related hangs: incorrect lttng_ht_destroy use
[lttng-tools.git] / src / bin / lttng-sessiond / cmd.c
index f130f5ebfb17f74f10ec87b1d784359504e99d63..4fcd6a4feafdf2eae0b1e4393dd69ecfd6716d5e 100644 (file)
@@ -397,7 +397,7 @@ static int add_uri_to_consumer(struct consumer_output *consumer,
                /* Set URI into consumer output object */
                ret = consumer_set_network_uri(consumer, uri);
                if (ret < 0) {
-                       ret = LTTNG_ERR_FATAL;
+                       ret = -ret;
                        goto error;
                } else if (ret == 1) {
                        /*
@@ -438,6 +438,8 @@ static int add_uri_to_consumer(struct consumer_output *consumer,
                break;
        }
 
+       ret = LTTNG_OK;
+
 error:
        return ret;
 }
@@ -1646,7 +1648,7 @@ int cmd_set_consumer_uri(int domain, struct ltt_session *session,
 
        for (i = 0; i < nb_uri; i++) {
                ret = add_uri_to_consumer(consumer, &uris[i], domain, session->name);
-               if (ret < 0) {
+               if (ret != LTTNG_OK) {
                        goto error;
                }
        }
@@ -1665,7 +1667,6 @@ int cmd_create_session_uri(char *name, struct lttng_uri *uris,
                size_t nb_uri, lttng_sock_cred *creds)
 {
        int ret;
-       char *path = NULL;
        struct ltt_session *session;
 
        assert(name);
@@ -1690,7 +1691,7 @@ int cmd_create_session_uri(char *name, struct lttng_uri *uris,
        }
 
        /* Create tracing session in the registry */
-       ret = session_create(name, path, LTTNG_SOCK_GET_UID_CRED(creds),
+       ret = session_create(name, LTTNG_SOCK_GET_UID_CRED(creds),
                        LTTNG_SOCK_GET_GID_CRED(creds));
        if (ret != LTTNG_OK) {
                goto session_error;
@@ -2064,9 +2065,9 @@ void cmd_list_lttng_sessions(struct lttng_session *sessions, uid_t uid,
                                (ksess && ksess->consumer->type == CONSUMER_DST_NET) ||
                                (usess && usess->consumer->type == CONSUMER_DST_NET)) {
                        ret = build_network_session_path(sessions[i].path,
-                                       sizeof(session[i].path), session);
+                                       sizeof(sessions[i].path), session);
                } else {
-                       ret = snprintf(sessions[i].path, sizeof(session[i].path), "%s",
+                       ret = snprintf(sessions[i].path, sizeof(sessions[i].path), "%s",
                                        session->consumer->dst.trace_path);
                }
                if (ret < 0) {
This page took 0.024597 seconds and 4 git commands to generate.