Missing error handling: consumer_signal_init should return its error status
[lttng-tools.git] / src / bin / lttng-sessiond / main.c
index 3e04f963329e6603c859164f1ee4ff4207a8e118..0b116e11820ff70ee483c132b2eef4215840a5d9 100644 (file)
@@ -3389,31 +3389,12 @@ skip_domain:
                        goto error;
                }
 
-               ret = cmd_set_consumer_uri(cmd_ctx->lsm->domain.type, cmd_ctx->session,
-                               nb_uri, uris);
+               ret = cmd_set_consumer_uri(cmd_ctx->session, nb_uri, uris);
+               free(uris);
                if (ret != LTTNG_OK) {
-                       free(uris);
                        goto error;
                }
 
-               /*
-                * XXX: 0 means that this URI should be applied on the session. Should
-                * be a DOMAIN enuam.
-                */
-               if (cmd_ctx->lsm->domain.type == 0) {
-                       /* Add the URI for the UST session if a consumer is present. */
-                       if (cmd_ctx->session->ust_session &&
-                                       cmd_ctx->session->ust_session->consumer) {
-                               ret = cmd_set_consumer_uri(LTTNG_DOMAIN_UST, cmd_ctx->session,
-                                               nb_uri, uris);
-                       } else if (cmd_ctx->session->kernel_session &&
-                                       cmd_ctx->session->kernel_session->consumer) {
-                               ret = cmd_set_consumer_uri(LTTNG_DOMAIN_KERNEL,
-                                               cmd_ctx->session, nb_uri, uris);
-                       }
-               }
-
-               free(uris);
 
                break;
        }
@@ -4464,6 +4445,7 @@ static int set_option(int opt, const char *arg, const char *optname)
                ret = -1;
        }
 
+end:
        if (ret == -EINVAL) {
                const char *opt_name = "unknown";
                int i;
@@ -4479,7 +4461,7 @@ static int set_option(int opt, const char *arg, const char *optname)
                WARN("Invalid argument provided for option \"%s\", using default value.",
                        opt_name);
        }
-end:
+
        return ret;
 }
 
@@ -5110,6 +5092,10 @@ int main(int argc, char **argv)
 
        if (is_root) {
                rundir = strdup(DEFAULT_LTTNG_RUNDIR);
+               if (!rundir) {
+                       ret = -ENOMEM;
+                       goto error;
+               }
 
                /* Create global run dir with root access */
                ret = create_lttng_rundir(rundir);
This page took 0.026246 seconds and 5 git commands to generate.