Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
uint64_t id = 0;
int ret;
+ /* We need to check for EOF here for empty files. */
+ if (unlikely(pos->offset == EOF))
+ return EOF;
+
ctf_pos_get_event(pos);
+ /*
+ * This is the EOF check after we've advanced the position in
+ * ctf_pos_get_event.
+ */
if (unlikely(pos->offset == EOF))
return EOF;
assert(pos->offset < pos->content_size);
/* empty packet */
pos->offset = index->data_offset;
offset = 0;
+ whence = SEEK_CUR;
goto read_next_packet;
} else {
pos->offset = EOF;