member = bt_ctf_field_structure_get_field(structure, name);
assert(member);
(void) bt_ctf_field_reset(member);
+ bt_put(member);
}
int bt_ctf_stream_flush(struct bt_ctf_stream *stream)
"content_size");
}
bt_put(integer);
+
+ if (ret < 0) {
+ /*
+ * We failed to write the packet. Its size is therefore set to 0
+ * to ensure the next mapping is done in the same place rather
+ * than advancing by "stream->pos.packet_size", which would
+ * leave a corrupted packet in the trace.
+ */
+ stream->pos.packet_size = 0;
+ }
return ret;
}