Fix ctf writer lints
[babeltrace.git] / formats / ctf / writer / writer.c
index d0fad8fbb0ab5d3fde5b0753b1f419839ade0418..75bf850c98080dbb16433d71c78deb5879715648 100644 (file)
@@ -168,11 +168,17 @@ void bt_ctf_writer_destroy(struct bt_ctf_ref *ref)
        }
 
        if (writer->trace_dir_fd > 0) {
-               close(writer->trace_dir_fd);
+               if (close(writer->trace_dir_fd)) {
+                       perror("close");
+                       abort();
+               }
        }
 
        if (writer->metadata_fd > 0) {
-               close(writer->metadata_fd);
+               if (close(writer->metadata_fd)) {
+                       perror("close");
+                       abort();
+               }
        }
 
        if (writer->environment) {
@@ -356,6 +362,7 @@ void append_trace_metadata(struct bt_ctf_writer *writer,
                struct metadata_context *context)
 {
        unsigned char *uuid = writer->uuid;
+       int ret;
 
        g_string_append(context->string, "trace {\n");
 
@@ -374,7 +381,9 @@ void append_trace_metadata(struct bt_ctf_writer *writer,
        g_string_append(context->string, "\tpacket.header := ");
        context->current_indentation_level++;
        g_string_assign(context->field_name, "");
-       bt_ctf_field_type_serialize(writer->trace_packet_header_type, context);
+       ret = bt_ctf_field_type_serialize(writer->trace_packet_header_type,
+               context);
+       assert(!ret);
        context->current_indentation_level--;
 
        g_string_append(context->string, ";\n};\n\n");
This page took 0.024158 seconds and 4 git commands to generate.