[PATCH] journal: fix endianness error

Frederic Crozat fcrozat at suse.com
Thu Mar 1 09:00:01 PST 2012


---
 src/journal/journal-file.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c
index 275caea..fd8f23d 100644
--- a/src/journal/journal-file.c
+++ b/src/journal/journal-file.c
@@ -833,7 +833,7 @@ static int link_entry_into_array(JournalFile *f,
         o->entry_array.items[i] = htole64(p);
 
         if (ap == 0)
-                *first = q;
+                *first = htole64(q);
         else {
                 r = journal_file_move_to_object(f, OBJECT_ENTRY_ARRAY, ap, &o);
                 if (r < 0)
@@ -866,7 +866,7 @@ static int link_entry_into_array_plus_one(JournalFile *f,
         else {
                 uint64_t i;
 
-                i = le64toh(*idx) - 1;
+                i = htole64(le64toh(*idx) - 1);
                 r = link_entry_into_array(f, first, &i, p);
                 if (r < 0)
                         return r;
-- 
1.7.7


--=-3CmrMgyqY9PslhR6Oqu/--



More information about the systemd-devel mailing list