X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=lib%2Fiterator.c;h=30a45423dfc1c2130b342aa7d274bd8dcd9b39d0;hp=d439d7b926c52f6cdee9a7716d2bc75d3d3d194f;hb=ccce44e83614322e21e6a90f271c7b89824fb968;hpb=1e8e8e2fb8ef9e36cbc2c5a692e9fa1d11cbb52a diff --git a/lib/iterator.c b/lib/iterator.c index d439d7b9..30a45423 100644 --- a/lib/iterator.c +++ b/lib/iterator.c @@ -144,6 +144,10 @@ static int seek_file_stream_by_timestamp(struct ctf_file_stream *cfs, continue; stream_pos->packet_seek(&stream_pos->parent, i, SEEK_SET); + ret = bt_packet_seek_get_error(); + if (ret < 0) { + return EOF; + } do { ret = stream_read_event(cfs); } while (cfs->parent.real_timestamp < timestamp && ret == 0); @@ -243,6 +247,10 @@ static int find_max_timestamp_ctf_file_stream(struct ctf_file_stream *cfs, */ for (i = stream_pos->packet_index->len - 1; i >= 0; i--) { stream_pos->packet_seek(&stream_pos->parent, i, SEEK_SET); + ret = bt_packet_seek_get_error(); + if (ret < 0) { + return EOF; + } count = 0; /* read each event until we reach the end of the stream */ do {