From 5034fb5ebaaad65f41cefdb833999772e04caa00 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Wed, 27 Nov 2013 19:00:49 -0500 Subject: [PATCH] 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 --- include/babeltrace/ctf/types.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; -- 2.34.1