Fix: disallow re-using same event ID in same stream
[babeltrace.git] / formats / ctf / ctf.c
index eec3350f3ba73b2c40c27c479943f3d80b4c093c..16a7ba0fd66e831b0691b17f75a812ace6964017 100644 (file)
@@ -1809,7 +1809,6 @@ int import_stream_packet_index(struct ctf_trace *td,
        struct ctf_packet_index ctf_index;
        struct ctf_packet_index_file_hdr index_hdr;
        struct packet_index index;
-       int index_read;
        int ret = 0;
        int first_packet = 1;
        size_t len;
@@ -1843,8 +1842,8 @@ int import_stream_packet_index(struct ctf_trace *td,
                goto error;
        }
 
-       while ((index_read = fread(&ctf_index, index_hdr.packet_index_len, 1,
-                                       pos->index_fp)) == 1) {
+       while (fread(&ctf_index, index_hdr.packet_index_len, 1,
+                       pos->index_fp) == 1) {
                uint64_t stream_id;
 
                memset(&index, 0, sizeof(index));
@@ -2189,6 +2188,7 @@ void ctf_init_mmap_pos(struct ctf_stream_pos *pos,
        pos->flags = MAP_PRIVATE;
        pos->parent.rw_table = read_dispatch_table;
        pos->parent.event_cb = ctf_read_event;
+       pos->priv = mmap_info->priv;
 }
 
 static
This page took 0.03996 seconds and 4 git commands to generate.