Fix: handle ENOENT when creating a kernel event
[lttng-tools.git] / src / bin / lttng-sessiond / kernel.c
index b6b24a5a2b2b426fc78845bb8ca4bf7b1f16770a..44a71fc595de1427682bf84b19991bf0725da1bd 100644 (file)
@@ -201,6 +201,9 @@ int kernel_create_event(struct lttng_event *ev,
                case ENOSYS:
                        WARN("Event type not implemented");
                        break;
+               case ENOENT:
+                       WARN("Event %s not found!", ev->name);
+                       break;
                default:
                        PERROR("create event ioctl");
                }
@@ -759,11 +762,11 @@ void kernel_destroy_session(struct ltt_kernel_session *ksess)
        DBG("Tearing down kernel session");
 
        /*
-        * Destroy channels on the consumer if in no output mode because the
-        * streams are in *no* monitor mode so we have to send a command to clean
-        * them up or else they leaked.
+        * Destroy channels on the consumer if at least one FD has been sent and we
+        * are in no output mode because the streams are in *no* monitor mode so we
+        * have to send a command to clean them up or else they leaked.
         */
-       if (!ksess->output_traces) {
+       if (!ksess->output_traces && ksess->consumer_fds_sent) {
                int ret;
                struct consumer_socket *socket;
                struct lttng_ht_iter iter;
This page took 0.025553 seconds and 5 git commands to generate.