Fix: UST returns -LTTNG_UST_ERR_NOENT and not -ENOENT
[lttng-tools.git] / src / bin / lttng-sessiond / ust-app.c
index 85f705542776215e2ea53f6b3bd00a0a9e8d0929..12c8f92244693a6e63fbfb9c4633a0daf24223e9 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;
@@ -739,6 +739,7 @@ static int create_ust_stream(struct ust_app *app,
        ret = ustctl_create_stream(app->sock, ua_sess->metadata->obj,
                        &ua_sess->metadata->stream_obj);
        if (ret < 0) {
+               lttng_fd_put(LTTNG_FD_APPS, 2);
                ERR("UST create metadata stream failed");
                goto error;
        }
@@ -1352,7 +1353,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;
                }
@@ -2291,7 +2292,7 @@ int ust_app_start_trace(struct ltt_ust_session *usess, struct ust_app *app)
                                /* Free unused memory and reset FD states. */
                                free(ustream);
                                lttng_fd_put(LTTNG_FD_APPS, 2);
-                               if (ret == -ENOENT) {
+                               if (ret == -LTTNG_UST_ERR_NOENT) {
                                        /* Got all streams. Continue normal execution. */
                                        break;
                                }
This page took 0.026708 seconds and 4 git commands to generate.