Add Trace CTF IR type
[babeltrace.git] / formats / ctf / ir / stream.c
index 9b0be90b7b2e97ad96f36e670060cb51192e33a9..57b893790ae36ca2a8e2122b72f083111ad31adf 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * stream.c
  *
- * Babeltrace CTF Writer
+ * Babeltrace CTF IR - Stream
  *
  * Copyright 2013, 2014 Jérémie Galarneau <jeremie.galarneau@efficios.com>
  *
@@ -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;
        }
This page took 0.023037 seconds and 4 git commands to generate.