Some functions are disabled in CTF writer mode and vice versa.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
struct bt_ctf_field *events_discarded_field = NULL;
struct bt_ctf_field_type *events_discarded_field_type = NULL;
struct bt_ctf_field *events_discarded_field = NULL;
struct bt_ctf_field_type *events_discarded_field_type = NULL;
- if (!stream || !count || !stream->packet_context) {
+ if (!stream || !count || !stream->packet_context ||
+ stream->pos.fd < 0) {
struct bt_ctf_field *events_discarded_field = NULL;
struct bt_ctf_field_type *events_discarded_field_type = NULL;
struct bt_ctf_field *events_discarded_field = NULL;
struct bt_ctf_field_type *events_discarded_field_type = NULL;
- if (!stream || !stream->packet_context) {
+ if (!stream || !stream->packet_context || stream->pos.fd < 0) {
- if (!stream || !event) {
+ if (!stream || !event || stream->pos.fd < 0) {
{
struct bt_ctf_field *packet_context = NULL;
{
struct bt_ctf_field *packet_context = NULL;
+ if (!stream || stream->pos.fd < 0) {
int ret = 0;
struct bt_ctf_field_type *field_type;
int ret = 0;
struct bt_ctf_field_type *field_type;
- if (!stream || !field) {
+ if (!stream || !field || stream->pos.fd < 0) {
{
struct bt_ctf_field *packet_header = NULL;
{
struct bt_ctf_field *packet_header = NULL;
+ if (!stream || stream->pos.fd < 0) {
struct bt_ctf_trace *trace = NULL;
struct bt_ctf_field_type *field_type = NULL;
struct bt_ctf_trace *trace = NULL;
struct bt_ctf_field_type *field_type = NULL;
- if (!stream || !field) {
+ if (!stream || !field || stream->pos.fd < 0) {