+ return -1;
+ }
+
+ wait_pipe_path = lttcomm_recv_string(sock);
+
+ if (!wait_pipe_path) {
+ lttng_consumer_send_error(ctx, CONSUMERD_ERROR_RECV_FD);
+ free(shm_path);
+ return -1;
+ }
+
+ DBG("consumer_add_stream received path %s", shm_path);
+ DBG("consumer_add_stream received path %s", wait_pipe_path);
+
+ fds[0] = open(shm_path, O_RDWR);
+
+ if (fds[0] < 0) {
+ DBG("consumer_add_stream open error on path %s", shm_path);
+ free(shm_path);
+ free(wait_pipe_path);
+ return -1;
+ }
+
+ fds[1] = open(wait_pipe_path, O_RDONLY);
+
+ if (fds[1] < 0) {
+ DBG("consumer_add_stream open error on path %s", wait_pipe_path);
+ PERROR("open");
+ free(shm_path);
+ free(wait_pipe_path);
+ return -1;
+ }
+
+ free(shm_path);
+ free(wait_pipe_path);
+
+ for (i = 0; i < 2; ++i) {
+ if (fcntl(fds[i], F_SETFD, FD_CLOEXEC) < 0) {
+ DBG("consumer_add_stream fcntl error");
+ return -1;
+ }