X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=formats%2Fctf%2Fctf.c;h=af1809efc8a0390986027bded924e6d2b3bb932e;hp=40da01da2d57619d1257fc42a4666923afaaeaa2;hb=edcad9c1c88e6e698040855d7518d0c27dfc4489;hpb=f4f0fb70266576f726efa583130680746df4c172 diff --git a/formats/ctf/ctf.c b/formats/ctf/ctf.c index 40da01da..af1809ef 100644 --- a/formats/ctf/ctf.c +++ b/formats/ctf/ctf.c @@ -53,6 +53,7 @@ #include "metadata/ctf-ast.h" #include "events-private.h" #include +#include #define LOG2_CHAR_BIT 3 @@ -906,9 +907,9 @@ void ctf_packet_seek(struct bt_stream_pos *stream_pos, size_t index, int whence) } pos->content_size = -1U; /* Unknown at this point */ pos->packet_size = WRITE_PACKET_LEN; - off = posix_fallocate(pos->fd, pos->mmap_offset, + off = bt_posix_fallocate(pos->fd, pos->mmap_offset, pos->packet_size / CHAR_BIT); - assert(off >= 0); + assert(off == 0); pos->offset = 0; } else { read_next_packet: @@ -1109,7 +1110,7 @@ int ctf_trace_metadata_packet_read(struct ctf_trace *td, FILE *in, memcpy(td->uuid, header.uuid, sizeof(header.uuid)); CTF_TRACE_SET_FIELD(td, uuid); } else { - if (babeltrace_uuid_compare(header.uuid, td->uuid)) + if (bt_uuid_compare(header.uuid, td->uuid)) return -EINVAL; } @@ -1595,7 +1596,7 @@ begin: elem = bt_array_index(defarray, i); uuidval[i] = bt_get_unsigned_int(elem); } - ret = babeltrace_uuid_compare(td->uuid, uuidval); + ret = bt_uuid_compare(td->uuid, uuidval); if (ret) { fprintf(stderr, "[error] Unique Universal Identifiers do not match.\n"); return -EINVAL; @@ -1855,10 +1856,10 @@ int import_stream_packet_index(struct ctf_trace *td, goto error; } if (be32toh(index_hdr.index_major) != CTF_INDEX_MAJOR) { - fprintf(stderr, "[error] Incompatible index file %" PRIu64 - ".%" PRIu64 ", supported %d.%d\n", - be64toh(index_hdr.index_major), - be64toh(index_hdr.index_minor), CTF_INDEX_MAJOR, + fprintf(stderr, "[error] Incompatible index file %" PRIu32 + ".%" PRIu32 ", supported %d.%d\n", + be32toh(index_hdr.index_major), + be32toh(index_hdr.index_minor), CTF_INDEX_MAJOR, CTF_INDEX_MINOR); ret = -1; goto error;