projects
/
babeltrace.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Extract int and char arrays from fields
[babeltrace.git]
/
formats
/
ctf
/
ctf.c
diff --git
a/formats/ctf/ctf.c
b/formats/ctf/ctf.c
index f9f9e47fde8947812b40034077431f04584a7000..27c03cfa8c2e23d211f2a5ed16fe5582f2f6bc66 100644
(file)
--- a/
formats/ctf/ctf.c
+++ b/
formats/ctf/ctf.c
@@
-127,8
+127,16
@@
int ctf_read_event(struct stream_pos *ppos, struct ctf_stream *stream)
uint64_t id = 0;
int ret;
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);
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);
if (unlikely(pos->offset == EOF))
return EOF;
assert(pos->offset < pos->content_size);
@@
-408,6
+416,7
@@
void ctf_move_pos_slow(struct ctf_stream_pos *pos, size_t offset, int whence)
/* empty packet */
pos->offset = index->data_offset;
offset = 0;
/* empty packet */
pos->offset = index->data_offset;
offset = 0;
+ whence = SEEK_CUR;
goto read_next_packet;
} else {
pos->offset = EOF;
goto read_next_packet;
} else {
pos->offset = EOF;
This page took
0.024839 seconds
and
4
git commands to generate.