projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: unprivilieged sessiond agent port clashes with root sessiond
[lttng-tools.git]
/
src
/
bin
/
lttng-relayd
/
main.c
diff --git
a/src/bin/lttng-relayd/main.c
b/src/bin/lttng-relayd/main.c
index a57b1d4b063e2d02f200fcd07f860276b1d6ae64..f5f1ad3b488ac91c5cd3eecddfd3c3799bbebaef 100644
(file)
--- a/
src/bin/lttng-relayd/main.c
+++ b/
src/bin/lttng-relayd/main.c
@@
-751,6
+751,7
@@
static struct lttcomm_sock *relay_socket_create(struct lttng_uri *uri)
ret = sock->ops->bind(sock);
if (ret < 0) {
ret = sock->ops->bind(sock);
if (ret < 0) {
+ PERROR("Failed to bind socket");
goto error;
}
goto error;
}
@@
-1588,6
+1589,7
@@
static
int rotate_truncate_stream(struct relay_stream *stream)
{
int ret, new_fd;
int rotate_truncate_stream(struct relay_stream *stream)
{
int ret, new_fd;
+ off_t lseek_ret;
uint64_t diff, pos = 0;
char buf[FILE_COPY_BUFFER_SIZE];
uint64_t diff, pos = 0;
char buf[FILE_COPY_BUFFER_SIZE];
@@
-1614,10
+1616,11
@@
int rotate_truncate_stream(struct relay_stream *stream)
* Rewind the current tracefile to the position at which the rotation
* should have occured.
*/
* Rewind the current tracefile to the position at which the rotation
* should have occured.
*/
- ret = lseek(stream->stream_fd->fd,
+
lseek_
ret = lseek(stream->stream_fd->fd,
stream->pos_after_last_complete_data_index, SEEK_SET);
stream->pos_after_last_complete_data_index, SEEK_SET);
- if (ret < 0) {
+ if (
lseek_
ret < 0) {
PERROR("seek truncate stream");
PERROR("seek truncate stream");
+ ret = -1;
goto end;
}
goto end;
}
@@
-1722,7
+1725,8
@@
int try_rotate_stream(struct relay_stream *stream)
goto end;
}
goto end;
}
- if (stream->prev_seq < stream->rotate_at_seq_num) {
+ if (stream->prev_seq < stream->rotate_at_seq_num ||
+ stream->prev_seq == -1ULL) {
DBG("Stream %" PRIu64 " no yet ready for rotation",
stream->stream_handle);
goto end;
DBG("Stream %" PRIu64 " no yet ready for rotation",
stream->stream_handle);
goto end;
@@
-2803,10
+2807,10
@@
int relay_rotate_pending(struct lttcomm_relayd_hdr *recv_hdr,
{
struct relay_session *session = conn->session;
struct lttcomm_relayd_rotate_pending msg;
{
struct relay_session *session = conn->session;
struct lttcomm_relayd_rotate_pending msg;
- struct lttcomm_relayd_
generic
_reply reply;
+ struct lttcomm_relayd_
rotate_pending
_reply reply;
struct lttng_ht_iter iter;
struct relay_stream *stream;
struct lttng_ht_iter iter;
struct relay_stream *stream;
- int ret;
+ int ret
= 0
;
ssize_t network_ret;
uint64_t chunk_id;
bool rotate_pending = false;
ssize_t network_ret;
uint64_t chunk_id;
bool rotate_pending = false;
@@
-2883,7
+2887,8
@@
int relay_rotate_pending(struct lttcomm_relayd_hdr *recv_hdr,
send_reply:
rcu_read_unlock();
memset(&reply, 0, sizeof(reply));
send_reply:
rcu_read_unlock();
memset(&reply, 0, sizeof(reply));
- reply.ret_code = htobe32(rotate_pending ? 1 : 0);
+ reply.generic.ret_code = htobe32((uint32_t) LTTNG_OK);
+ reply.is_pending = (uint8_t) !!rotate_pending;
network_ret = conn->sock->ops->sendmsg(conn->sock, &reply,
sizeof(reply), 0);
if (network_ret < (ssize_t) sizeof(reply)) {
network_ret = conn->sock->ops->sendmsg(conn->sock, &reply,
sizeof(reply), 0);
if (network_ret < (ssize_t) sizeof(reply)) {
This page took
0.024526 seconds
and
4
git commands to generate.