Fix: Remove bad condition and fix overflow issue
[lttng-tools.git] / 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.023137 seconds and 4 git commands to generate.