Fix: Use the packet's final size when mmap-ing the next packet
[babeltrace.git] / formats / ctf / ctf.c
index 752b548e766d37bc60cf3fc21215f10eb894fc55..60d9c9f9459d159b7627c9e76927409eccd55272 100644 (file)
@@ -670,7 +670,7 @@ int ctf_fini_pos(struct ctf_stream_pos *pos)
 
 /*
  * for SEEK_CUR: go to next packet.
- * for SEEK_POS: go to packet numer (index).
+ * for SEEK_SET: go to packet numer (index).
  */
 void ctf_packet_seek(struct bt_stream_pos *stream_pos, size_t index, int whence)
 {
@@ -712,7 +712,7 @@ void ctf_packet_seek(struct bt_stream_pos *stream_pos, size_t index, int whence)
                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 */
This page took 0.024411 seconds and 4 git commands to generate.