Rename LTTng index in CTF index
[lttng-tools.git] / src / common / index / index.c
index cddc58c09de1726b8322816b4eb3f308dace03f3..2946f7bab3335e5456d9628d9e0a3c6707e0eca6 100644 (file)
@@ -36,7 +36,7 @@ int index_create_file(char *path_name, char *stream_name, int uid, int gid,
 {
        int ret, fd = -1;
        ssize_t size_ret;
-       struct lttng_packet_index_file_hdr hdr;
+       struct ctf_packet_index_file_hdr hdr;
        char fullpath[PATH_MAX];
 
        ret = snprintf(fullpath, sizeof(fullpath), "%s/" DEFAULT_INDEX_DIR,
@@ -62,9 +62,10 @@ int index_create_file(char *path_name, char *stream_name, int uid, int gid,
        }
        fd = ret;
 
-       memcpy(hdr.magic, INDEX_MAGIC, sizeof(hdr.magic));
-       hdr.index_major = htobe32(INDEX_MAJOR);
-       hdr.index_minor = htobe32(INDEX_MINOR);
+       hdr.magic = htobe32(CTF_INDEX_MAGIC);
+       hdr.index_major = htobe32(CTF_INDEX_MAJOR);
+       hdr.index_minor = htobe32(CTF_INDEX_MINOR);
+       hdr.packet_index_len = sizeof(struct ctf_packet_index);
 
        size_ret = lttng_write(fd, &hdr, sizeof(hdr));
        if (size_ret < sizeof(hdr)) {
@@ -93,7 +94,7 @@ error:
  * Return "len" on success or else < len on error. errno contains error
  * details.
  */
-ssize_t index_write(int fd, struct lttng_packet_index *index, size_t len)
+ssize_t index_write(int fd, struct ctf_packet_index *index, size_t len)
 {
        ssize_t ret;
 
This page took 0.023731 seconds and 4 git commands to generate.