X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fjournal%2Fjournal-verify.c;h=5d134bdb9763d7c495f0c7708d40119b8b2d1835;hp=90739a66c2cde0c2283540764b78fe3a3915c090;hb=2b43f939a4b3ad5aeb2650868b0234ff42ec0045;hpb=369f0589218a874a88bc69c5481d8f90f987b7dd diff --git a/src/journal/journal-verify.c b/src/journal/journal-verify.c index 90739a66c..5d134bdb9 100644 --- a/src/journal/journal-verify.c +++ b/src/journal/journal-verify.c @@ -63,6 +63,7 @@ static int journal_file_object_verify(JournalFile *f, Object *o) { h1 = le64toh(o->data.hash); if (o->object.flags & OBJECT_COMPRESSED) { +#ifdef HAVE_XZ void *b = NULL; uint64_t alloc = 0, b_size; @@ -73,6 +74,9 @@ static int journal_file_object_verify(JournalFile *f, Object *o) { h2 = hash64(b, b_size); free(b); +#else + return -EPROTONOSUPPORT; +#endif } else h2 = hash64(o->data.payload, le64toh(o->object.size) - offsetof(Object, data.payload)); @@ -249,7 +253,7 @@ static int contains_uint64(MMapCache *m, int fd, uint64_t n, uint64_t p) { c = (a + b) / 2; - r = mmap_cache_get(m, fd, PROT_READ|PROT_WRITE, 0, c * sizeof(uint64_t), sizeof(uint64_t), (void **) &z); + r = mmap_cache_get(m, fd, PROT_READ|PROT_WRITE, 0, false, c * sizeof(uint64_t), sizeof(uint64_t), NULL, (void **) &z); if (r < 0) return r; @@ -261,9 +265,8 @@ static int contains_uint64(MMapCache *m, int fd, uint64_t n, uint64_t p) { if (p < *z) b = c; - else { + else a = c; - } } return 0; @@ -1119,7 +1122,7 @@ int journal_file_verify( close_nointr_nofail(entry_array_fd); if (first_validated) - *first_validated = last_tag_realtime ? le64toh(f->header->head_entry_realtime) : 0; + *first_validated = last_sealed_realtime > 0 ? le64toh(f->header->head_entry_realtime) : 0; if (last_validated) *last_validated = last_sealed_realtime; if (last_contained)