summaryrefslogtreecommitdiff
path: root/src/journal/journal-file.c
diff options
context:
space:
mode:
authorFrederic Crozat <fcrozat@suse.com>2012-03-16 11:59:04 +0100
committerLennart Poettering <lennart@poettering.net>2012-03-22 01:09:37 +0100
commit4fd052aede13eb3041277c54ac2f5dee6e6c29cf (patch)
treea78001fa71f8e01e262123dfabebe3a23b41f8b7 /src/journal/journal-file.c
parent170dcb7bd575f61aa75ce55d7fc0183ace6b8b76 (diff)
add sparse support to detect endianness bug
le16/32/64_t type should be used when storing little-endian value header to integrate with sparse from Josh Triplett <josh@joshtriplett.org>
Diffstat (limited to 'src/journal/journal-file.c')
-rw-r--r--src/journal/journal-file.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c
index 5d540a7d40..c7ebcdb25c 100644
--- a/src/journal/journal-file.c
+++ b/src/journal/journal-file.c
@@ -793,8 +793,8 @@ static uint64_t journal_file_entry_array_n_items(Object *o) {
}
static int link_entry_into_array(JournalFile *f,
- uint64_t *first,
- uint64_t *idx,
+ le64_t *first,
+ le64_t *idx,
uint64_t p) {
int r;
uint64_t n = 0, ap = 0, q, i, a, hidx;
@@ -857,9 +857,9 @@ static int link_entry_into_array(JournalFile *f,
}
static int link_entry_into_array_plus_one(JournalFile *f,
- uint64_t *extra,
- uint64_t *first,
- uint64_t *idx,
+ le64_t *extra,
+ le64_t *first,
+ le64_t *idx,
uint64_t p) {
int r;
@@ -873,7 +873,7 @@ static int link_entry_into_array_plus_one(JournalFile *f,
if (*idx == 0)
*extra = htole64(p);
else {
- uint64_t i;
+ le64_t i;
i = htole64(le64toh(*idx) - 1);
r = link_entry_into_array(f, first, &i, p);
@@ -2144,7 +2144,8 @@ int journal_file_copy_entry(JournalFile *from, JournalFile *to, Object *o, uint6
items = alloca(sizeof(EntryItem) * n);
for (i = 0; i < n; i++) {
- uint64_t le_hash, l, h;
+ uint64_t l, h;
+ le64_t le_hash;
size_t t;
void *data;
Object *u;