Fix: Remove bad condition and fix overflow issue
authorDavid Goulet <dgoulet@efficios.com>
Mon, 22 Oct 2012 20:44:51 +0000 (16:44 -0400)
committerDavid Goulet <dgoulet@efficios.com>
Mon, 22 Oct 2012 21:04:12 +0000 (17:04 -0400)
Signed-off-by: David Goulet <dgoulet@efficios.com>
src/bin/lttng-relayd/main.c

index 0f81d556dd4df73a910471756b75cf6567581a36..ebbe5e3930af3ea8b559054fdab8cbdc3d3eab6a 100644 (file)
@@ -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 {
This page took 0.03328 seconds and 4 git commands to generate.