X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=formats%2Fctf%2Fir%2Fstream.c;h=57b893790ae36ca2a8e2122b72f083111ad31adf;hb=bc37ae52aa6face901440bf7eb2171104b5343d8;hp=9b0be90b7b2e97ad96f36e670060cb51192e33a9;hpb=12c8a1a3121ed7125e8758065c44658d8eda1333;p=babeltrace.git diff --git a/formats/ctf/ir/stream.c b/formats/ctf/ir/stream.c index 9b0be90b..57b89379 100644 --- a/formats/ctf/ir/stream.c +++ b/formats/ctf/ir/stream.c @@ -1,7 +1,7 @@ /* * stream.c * - * Babeltrace CTF Writer + * Babeltrace CTF IR - Stream * * Copyright 2013, 2014 Jérémie Galarneau * @@ -326,7 +326,11 @@ int bt_ctf_stream_flush(struct bt_ctf_stream *stream) struct bt_ctf_field *integer = NULL; struct ctf_stream_pos packet_context_pos; - if (!stream) { + if (!stream || stream->pos.fd < 0) { + /* + * Stream does not have an associated fd. It is, + * therefore, not a stream being used to write events. + */ ret = -1; goto end; }