+ perror("send consumer channel");
+ goto error;
+ }
+
+ /* Send metadata stream fd */
+ lkm.cmd_type = LTTNG_CONSUMER_ADD_STREAM;
+ lkm.u.stream.channel_key = session->metadata->fd;
+ lkm.u.stream.stream_key = session->metadata_stream_fd;
+ lkm.u.stream.state = LTTNG_CONSUMER_ACTIVE_STREAM;
+ lkm.u.stream.output = DEFAULT_KERNEL_CHANNEL_OUTPUT;
+ lkm.u.stream.mmap_len = 0; /* for kernel */
+ strncpy(lkm.u.stream.path_name, session->metadata->pathname, PATH_MAX - 1);
+ lkm.u.stream.path_name[PATH_MAX - 1] = '\0';
+ DBG("Sending metadata stream %d to consumer", lkm.u.stream.stream_key);
+ ret = lttcomm_send_unix_sock(sock, &lkm, sizeof(lkm));
+ if (ret < 0) {
+ perror("send consumer stream");
+ goto error;
+ }
+ ret = lttcomm_send_fds_unix_sock(sock, &session->metadata_stream_fd, 1);
+ if (ret < 0) {
+ perror("send consumer stream");