X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=formats%2Fctf%2Fctf.c;h=c369d8d36487ae79980a1caa747a79a4f2f916ec;hp=69917f7fb5d9cfc8dcaf246128f77d93557d7c6d;hb=bcbfb8bf88ea9afbecd8a79708939fb8b79e5734;hpb=afe9cd4a86956a4ae2664422a557b9975ff02b00 diff --git a/formats/ctf/ctf.c b/formats/ctf/ctf.c index 69917f7f..c369d8d3 100644 --- a/formats/ctf/ctf.c +++ b/formats/ctf/ctf.c @@ -1011,6 +1011,7 @@ int ctf_open_trace_metadata_read(struct ctf_trace *td, if (metadata_fp) { fp = metadata_fp; + metadata_stream->pos.fd = -1; } else { td->metadata = &metadata_stream->parent; metadata_stream->pos.fd = openat(td->dirfd, "metadata", O_RDONLY); @@ -1090,7 +1091,8 @@ end_packet_read: fclose(fp); free(buf); end_stream: - close(metadata_stream->pos.fd); + if (metadata_stream->pos.fd >= 0) + close(metadata_stream->pos.fd); if (ret) g_free(metadata_stream); return ret; @@ -1746,6 +1748,11 @@ int ctf_open_mmap_stream_read(struct ctf_trace *td, if (ret) goto error_index; + /* + * For now, only a single slock is supported. + */ + file_stream->parent.current_clock = td->single_clock; + /* Add stream file to stream class */ g_ptr_array_add(file_stream->parent.stream_class->streams, &file_stream->parent);