X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=formats%2Fctf%2Fctf.c;h=5cf8097ce709892580c49957cf4751f9bc2e753b;hb=a52600470ad14e59cba2e17de3df3f3f336b1adb;hp=794e428c51d069a97354826b17f0f391afbafcbf;hpb=a7ac9efd15a5a41c3f10358de621923099531755;p=babeltrace.git diff --git a/formats/ctf/ctf.c b/formats/ctf/ctf.c index 794e428c..5cf8097c 100644 --- a/formats/ctf/ctf.c +++ b/formats/ctf/ctf.c @@ -471,6 +471,15 @@ int ctf_read_event(struct bt_stream_pos *ppos, struct ctf_stream_definition *str */ if (unlikely(pos->offset == EOF)) return EOF; + + if (pos->content_size == 0) { + /* Stream is inactive for now (live reading). */ + return EAGAIN; + } + /* Packet only contains headers */ + if (pos->offset == pos->content_size) + return EAGAIN; + assert(pos->offset < pos->content_size); /* Read event header */