From: Mathieu Desnoyers Date: Thu, 28 Nov 2013 00:00:49 +0000 (-0500) Subject: Fix: read/write mode check X-Git-Tag: v1.2.0-rc1~39^2~2 X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=commitdiff_plain;h=5034fb5ebaaad65f41cefdb833999772e04caa00 Fix: read/write mode check 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 --- diff --git a/include/babeltrace/ctf/types.h b/include/babeltrace/ctf/types.h index fad578ff..e90464dc 100644 --- a/include/babeltrace/ctf/types.h +++ b/include/babeltrace/ctf/types.h @@ -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;