From: David Goulet Date: Mon, 22 Oct 2012 20:44:51 +0000 (-0400) Subject: Fix: Remove bad condition and fix overflow issue X-Git-Tag: v2.1.0-rc6~31 X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=commitdiff_plain;h=33832e643df265121266c16fd5dc54313e86e20f;hp=df27ef7b025240e4b93a74193fb61569fb8d3d14 Fix: Remove bad condition and fix overflow issue Signed-off-by: David Goulet --- 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 {