Fix the case were the last stream is completely empty and return EOF.
This return value was returned even if other streams were valid
Signed-off-by: Yannick Brosseau <yannick.brosseau@gmail.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
struct ctf_file_stream **cfsp,
uint64_t *max_timestamp)
{
- int ret = EOF, i;
+ int ret = EOF, i, found = 0;
for (i = 0; i < stream_class->streams->len; i++) {
struct ctf_stream_definition *stream;
if (current_max_ts >= *max_timestamp) {
*max_timestamp = current_max_ts;
*cfsp = cfs;
+ found = 1;
}
}
assert(ret >= 0 || ret == EOF);
+ if (found) {
+ return 0;
+ }
return ret;
}