X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=plugins%2Fctf%2Ffs-sink%2Fwrite.c;h=dd380f5b667cd062f9c28a53cede8e360398f553;hb=387483fca23fe90a5d2470581192049ef74ec3ec;hp=a3cc5c8bbfa99141205cb64574f8cb96fa7f0fe5;hpb=ec273a889c7b3ee1dd41dcab0a3663cf64bd0dcd;p=babeltrace.git diff --git a/plugins/ctf/fs-sink/write.c b/plugins/ctf/fs-sink/write.c index a3cc5c8b..dd380f5b 100644 --- a/plugins/ctf/fs-sink/write.c +++ b/plugins/ctf/fs-sink/write.c @@ -648,7 +648,6 @@ enum bt_component_status writer_new_packet( struct bt_ctf_packet *packet) { struct bt_ctf_stream *stream = NULL, *writer_stream = NULL; - struct bt_ctf_field *writer_packet_context = NULL; enum bt_component_status ret = BT_COMPONENT_STATUS_OK; int int_ret; @@ -667,23 +666,21 @@ enum bt_component_status writer_new_packet( } BT_PUT(stream); - writer_packet_context = ctf_copy_packet_context(writer_component->err, - packet, writer_stream); - if (!writer_packet_context) { + int_ret = ctf_stream_copy_packet_context( + writer_component->err, packet, writer_stream); + if (int_ret < 0) { fprintf(writer_component->err, "[error] %s in %s:%d\n", __func__, __FILE__, __LINE__); goto error; } - int_ret = bt_ctf_stream_set_packet_context(writer_stream, - writer_packet_context); - if (int_ret < 0) { - fprintf(writer_component->err, "[error] %s in %s:%d\n", __func__, - __FILE__, __LINE__); + ret = ctf_stream_copy_packet_header(writer_component->err, + packet, writer_stream); + if (ret != 0) { + fprintf(writer_component->err, "[error] %s in %s:%d\n", + __func__, __FILE__, __LINE__); goto error; } - BT_PUT(writer_stream); - BT_PUT(writer_packet_context); goto end; @@ -691,7 +688,6 @@ error: ret = BT_COMPONENT_STATUS_ERROR; end: bt_put(writer_stream); - bt_put(writer_packet_context); bt_put(stream); return ret; }