- if (pos->fd >= 0) {
- /*
- * PROT_READ ctf_packet_seek is called from within
- * ctf_pos_get_event so end of packet does not change
- * the packet context on for the last event of the
- * packet.
- */
- if ((pos->prot == PROT_WRITE)
- && (unlikely(pos->offset + bit_offset >= pos->packet_size))) {
- printf_debug("ctf_packet_seek (before call): %" PRId64 "\n",
- pos->offset);
- ctf_packet_seek(&pos->parent, 0, SEEK_CUR);
- printf_debug("ctf_packet_seek (after call): %" PRId64 "\n",
- pos->offset);
- return;
- }
+ printf_debug("ctf_move_pos test EOF: %" PRId64 "\n", pos->offset);
+ ret = ctf_pos_access_ok(pos, bit_offset);
+ if (!ret) {
+ goto end;