Fix: change function name for better meaning
[lttng-tools.git] / src / bin / lttng-sessiond / ust-app.c
index 7da843a9e0a1d1bb56ba896e8283d28fec301358..22b395773b2efe922ef8f1e579fd71e07161bb04 100644 (file)
@@ -721,9 +721,9 @@ error:
 }
 
 /*
- * Create stream onto the UST tracer for a UST session.
+ * Create metadata stream onto the UST tracer for a given session.
  */
-static int create_ust_stream(struct ust_app *app,
+static int create_ust_metadata_stream(struct ust_app *app,
                struct ust_app_session *ua_sess)
 {
        int ret;
@@ -1375,7 +1375,7 @@ static int create_ust_app_metadata(struct ust_app_session *ua_sess,
 
        /* Open UST metadata stream */
        if (ua_sess->metadata->stream_obj == NULL) {
-               ret = create_ust_stream(app, ua_sess);
+               ret = create_ust_metadata_stream(app, ua_sess);
                if (ret < 0) {
                        goto error;
                }
@@ -2320,11 +2320,16 @@ int ust_app_start_trace(struct ltt_ust_session *usess, struct ust_app *app)
                        ret = ustctl_create_stream(app->sock, ua_chan->obj,
                                        &ustream->obj);
                        if (ret < 0) {
-                               /* Got all streams */
-                               lttng_fd_put(LTTNG_FD_APPS, 2);
+                               /* Free unused memory and reset FD states. */
                                free(ustream);
+                               lttng_fd_put(LTTNG_FD_APPS, 2);
+                               if (ret == -ENOENT) {
+                                       /* Got all streams. Continue normal execution. */
+                                       break;
+                               }
+                               /* Error at this point. Stop everything. */
                                ret = LTTNG_ERR_UST_STREAM_FAIL;
-                               break;
+                               goto error_rcu_unlock;
                        }
                        ustream->handle = ustream->obj->handle;
 
This page took 0.027137 seconds and 5 git commands to generate.