Fix: read/write mode check
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 28 Nov 2013 00:00:49 +0000 (19:00 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 28 Nov 2013 00:00:49 +0000 (19:00 -0500)
It's on the "prot" field, not flags. Moreover, it needs to be done with
a == / != comparison, not a mask.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
include/babeltrace/ctf/types.h

index fad578ff267d3f88b2a966b9c60f6aeacb334c21..e90464dc76243e02a0c1d250ae973cd48cb45fa0 100644 (file)
@@ -141,7 +141,7 @@ int ctf_move_pos(struct ctf_stream_pos *pos, uint64_t bit_offset)
        printf_debug("ctf_move_pos test EOF: %" PRId64 "\n", pos->offset);
        if (unlikely(pos->offset == EOF))
                return 0;
-       if (pos->flags & PROT_READ)
+       if (pos->prot == PROT_READ)
                max_len = pos->content_size;
        else
                max_len = pos->packet_size;
@@ -208,7 +208,7 @@ int ctf_pos_access_ok(struct ctf_stream_pos *pos, uint64_t bit_len)
 
        if (unlikely(pos->offset == EOF))
                return 0;
-       if (pos->flags & PROT_READ)
+       if (pos->prot == PROT_READ)
                max_len = pos->content_size;
        else
                max_len = pos->packet_size;
This page took 0.0256 seconds and 4 git commands to generate.