From 33832e643df265121266c16fd5dc54313e86e20f Mon Sep 17 00:00:00 2001 From: David Goulet Date: Mon, 22 Oct 2012 16:44:51 -0400 Subject: [PATCH] Fix: Remove bad condition and fix overflow issue Signed-off-by: David Goulet --- src/bin/lttng-relayd/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/bin/lttng-relayd/main.c b/src/bin/lttng-relayd/main.c index 0f81d556d..ebbe5e393 100644 --- a/src/bin/lttng-relayd/main.c +++ b/src/bin/lttng-relayd/main.c @@ -1355,7 +1355,8 @@ int relay_data_available(struct lttcomm_relayd_hdr *recv_hdr, " and last_seq %" PRIu64, stream_id, stream->prev_seq, last_net_seq_num); - if (stream->prev_seq == -1UL || stream->prev_seq <= last_net_seq_num) { + /* Avoid wrapping issue */ + if (((int64_t) (stream->prev_seq - last_net_seq_num)) <= 0) { /* Data has in fact been written and is available */ ret = 1; } else { -- 2.34.1