goto error_destroy;
}
- writer->trace_dir_fd = open(path, O_RDONLY | O_DIRECTORY,
- S_IRWXU | S_IRWXG);
+ writer->trace_dir_fd = open(path, O_RDONLY, S_IRWXU | S_IRWXG);
if (writer->trace_dir_fd < 0) {
perror("open");
goto error_destroy;
}
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) {
struct metadata_context *context)
{
unsigned char *uuid = writer->uuid;
+ int ret;
g_string_append(context->string, "trace {\n");
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");