ir: make sure you can't add a SC to a trace with a native BO
[babeltrace.git] / lib / ctf-ir / trace.c
index 5229338106bc4c37b1c489582a9c87a89e2baa0b..1b239fa3f457f1c3f5dbb30e72791bbb6bcfe153 100644 (file)
@@ -465,6 +465,15 @@ int bt_ctf_trace_add_stream_class(struct bt_ctf_trace *trace,
                goto end;
        }
 
+       /*
+        * At the end of this function we freeze the trace, so its
+        * native byte order must NOT be BT_CTF_BYTE_ORDER_NATIVE.
+        */
+       if (trace->native_byte_order == BT_CTF_BYTE_ORDER_NATIVE) {
+               ret = -1;
+               goto end;
+       }
+
        current_parent_trace = bt_ctf_stream_class_get_trace(stream_class);
        if (current_parent_trace) {
                /* Stream class is already associated to a trace, abort. */
This page took 0.023644 seconds and 4 git commands to generate.