ctf_packet_seek() assumed that a packet would be of fixed size
"WRITE_PACKET_LEN" when seeking to the next packet in write mode.
This ensures that the real size used.
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Reviewed-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
switch (whence) {
case SEEK_CUR:
/* The writer will add padding */
- pos->mmap_offset += WRITE_PACKET_LEN / CHAR_BIT;
+ pos->mmap_offset += pos->packet_size / CHAR_BIT;
break;
case SEEK_SET:
assert(index == 0); /* only seek supported for now */