X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=lib%2Fiterator.c;h=e3ae0689d80ce429da64748f0d7866536900f01b;hp=784166f2bf167caa672144716df4aa5dde315832;hb=5d2a5af291195537c5a589e388ddf2e2747fd6c5;hpb=2ae35d4f897d402facccddd4ce4d74df310bfb16 diff --git a/lib/iterator.c b/lib/iterator.c index 784166f2..e3ae0689 100644 --- a/lib/iterator.c +++ b/lib/iterator.c @@ -118,11 +118,10 @@ static int seek_file_stream_by_timestamp(struct ctf_file_stream *cfs, continue; stream_pos->packet_seek(&stream_pos->parent, i, SEEK_SET); - while (cfs->parent.timestamp < timestamp) { + do { ret = stream_read_event(cfs); - if (ret < 0) - break; - } + } while (cfs->parent.timestamp < timestamp && ret >= 0); + return 0; } return EOF;