Skip to contentSkip to conversation

Fix: 32bit values index_major/minor used as 64bit

PATCH Jérémie Galarneau 1 participant 1 message Aug 18, 2015 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

Merged in both master and stable-1.2.

Thanks!
Jérémie

Quoted 30 lines · Michael Jeanson

This patch fixes compiler warnings on big endian architectures where be64toh() is a nop and returns the original type.

---
 formats/ctf/ctf.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
formats/ctf/ctf.c +4 -5
index 5436c2a..74fcb5b 100644
@@ -1853,10 +1853,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;
--

1.9.1

Signature · 8 lines
Jérémie Galarneau
EfficiOS Inc.
http://www.efficios.com

_______________________________________________
lttng-dev mailing list
[email protected]
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev