projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: relayd vs consumerd compatibility
[lttng-tools.git]
/
src
/
common
/
consumer
/
consumer-stream.c
diff --git
a/src/common/consumer/consumer-stream.c
b/src/common/consumer/consumer-stream.c
index a62cef272294d360953e5d685fca745d7509bcff..522b3cd5cd8ac0c45876c12dd7e344c8c7c27118 100644
(file)
--- a/
src/common/consumer/consumer-stream.c
+++ b/
src/common/consumer/consumer-stream.c
@@
-163,12
+163,9
@@
void consumer_stream_close(struct lttng_consumer_stream *stream)
stream->out_fd = -1;
}
stream->out_fd = -1;
}
- if (stream->index_fd >= 0) {
- ret = close(stream->index_fd);
- if (ret) {
- PERROR("close stream index_fd");
- }
- stream->index_fd = -1;
+ if (stream->index_file) {
+ lttng_index_file_put(stream->index_file);
+ stream->index_file = NULL;
}
/* Check and cleanup relayd if needed. */
}
/* Check and cleanup relayd if needed. */
@@
-359,27
+356,23
@@
void consumer_stream_destroy(struct lttng_consumer_stream *stream,
* Return 0 on success or else a negative value.
*/
int consumer_stream_write_index(struct lttng_consumer_stream *stream,
* Return 0 on success or else a negative value.
*/
int consumer_stream_write_index(struct lttng_consumer_stream *stream,
- struct ctf_packet_index *
index
)
+ struct ctf_packet_index *
element
)
{
int ret;
struct consumer_relayd_sock_pair *relayd;
assert(stream);
{
int ret;
struct consumer_relayd_sock_pair *relayd;
assert(stream);
- assert(
index
);
+ assert(
element
);
rcu_read_lock();
relayd = consumer_find_relayd(stream->net_seq_idx);
if (relayd) {
pthread_mutex_lock(&relayd->ctrl_sock_mutex);
rcu_read_lock();
relayd = consumer_find_relayd(stream->net_seq_idx);
if (relayd) {
pthread_mutex_lock(&relayd->ctrl_sock_mutex);
- ret = relayd_send_index(&relayd->control_sock,
index
,
+ ret = relayd_send_index(&relayd->control_sock,
element
,
stream->relayd_stream_id, stream->next_net_seq_num - 1);
pthread_mutex_unlock(&relayd->ctrl_sock_mutex);
} else {
stream->relayd_stream_id, stream->next_net_seq_num - 1);
pthread_mutex_unlock(&relayd->ctrl_sock_mutex);
} else {
- ssize_t size_ret;
-
- size_ret = index_write(stream->index_fd, index,
- sizeof(struct ctf_packet_index));
- if (size_ret < sizeof(struct ctf_packet_index)) {
+ if (lttng_index_file_write(stream->index_file, element)) {
ret = -1;
} else {
ret = 0;
ret = -1;
} else {
ret = 0;
This page took
0.026409 seconds
and
5
git commands to generate.