X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=liblttng-consumer%2Flttng-consumer.c;h=5311860e01ac3d5c145991c194d3f3a32060d96f;hp=f031d5a677c4675aa659fcaaf90695e6d5571677;hb=74d0b6427faafd5f5d59b7e9d5f78ac52924a7a2;hpb=3bd1e0819b577ffcb44acd7c2f8e02ff09654b7b diff --git a/liblttng-consumer/lttng-consumer.c b/liblttng-consumer/lttng-consumer.c index f031d5a67..5311860e0 100644 --- a/liblttng-consumer/lttng-consumer.c +++ b/liblttng-consumer/lttng-consumer.c @@ -125,10 +125,11 @@ void consumer_del_stream(struct lttng_consumer_stream *stream) if (stream->out_fd >= 0) { close(stream->out_fd); } - if (stream->wait_fd >= 0) { + if (stream->wait_fd >= 0 && !stream->wait_fd_is_copy) { close(stream->wait_fd); } - if (stream->shm_fd >= 0 && stream->wait_fd != stream->shm_fd) { + if (stream->shm_fd >= 0 && stream->wait_fd != stream->shm_fd + && !stream->shm_fd_is_copy) { close(stream->shm_fd); } if (!--stream->chan->refcount) @@ -282,10 +283,11 @@ void consumer_del_channel(struct lttng_consumer_channel *channel) perror("munmap"); } } - if (channel->wait_fd >= 0) { + if (channel->wait_fd >= 0 && !channel->wait_fd_is_copy) { close(channel->wait_fd); } - if (channel->shm_fd >= 0 && channel->wait_fd != channel->shm_fd) { + if (channel->shm_fd >= 0 && channel->wait_fd != channel->shm_fd + && !channel->shm_fd_is_copy) { close(channel->shm_fd); } free(channel); @@ -916,11 +918,11 @@ void *lttng_consumer_thread_receive_fds(void *data) goto end; } - DBG("Sending ready command to ltt-sessiond"); + DBG("Sending ready command to lttng-sessiond"); ret = lttng_consumer_send_error(ctx, CONSUMERD_COMMAND_SOCK_READY); /* return < 0 on error, but == 0 is not fatal */ if (ret < 0) { - ERR("Error sending ready command to ltt-sessiond"); + ERR("Error sending ready command to lttng-sessiond"); goto end; }