X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fjournal%2Fjournal-verify.c;h=b03335ef31c98faab8783c28d37d7004d4f6675e;hb=fa6ac76083b8ffc1309876459f54f9f0e2843731;hp=333757b5b54b8a023da35ae1b137c4dfd58bc4ae;hpb=54f3ff079f05fd024ff3686eeea26ab705994494;p=elogind.git diff --git a/src/journal/journal-verify.c b/src/journal/journal-verify.c index 333757b5b..b03335ef3 100644 --- a/src/journal/journal-verify.c +++ b/src/journal/journal-verify.c @@ -142,7 +142,7 @@ static int journal_file_object_verify(JournalFile *f, uint64_t offset, Object *o compression = o->object.flags & OBJECT_COMPRESSION_MASK; if (compression) { _cleanup_free_ void *b = NULL; - uint64_t alloc = 0, b_size; + size_t alloc = 0, b_size; r = decompress_blob(compression, o->data.payload, @@ -427,7 +427,7 @@ static int entry_points_to_data( /* Check if this entry is also in main entry array. Since the * main entry array has already been verified we can rely on - * its consistency.*/ + * its consistency. */ i = 0; n = le64toh(f->header->n_entries); @@ -804,7 +804,7 @@ int journal_file_verify( usec_t last_usec = 0; int data_fd = -1, entry_fd = -1, entry_array_fd = -1; unsigned i; - bool found_last; + bool found_last = false; #ifdef HAVE_GCRYPT uint64_t last_tag = 0; #endif @@ -825,21 +825,21 @@ int journal_file_verify( data_fd = open_tmpfile("/var/tmp", O_RDWR | O_CLOEXEC); if (data_fd < 0) { - log_error("Failed to create data file: %m"); + log_error_errno(errno, "Failed to create data file: %m"); r = -errno; goto fail; } entry_fd = open_tmpfile("/var/tmp", O_RDWR | O_CLOEXEC); if (entry_fd < 0) { - log_error("Failed to create entry file: %m"); + log_error_errno(errno, "Failed to create entry file: %m"); r = -errno; goto fail; } entry_array_fd = open_tmpfile("/var/tmp", O_RDWR | O_CLOEXEC); if (entry_array_fd < 0) { - log_error("Failed to create entry array file: %m"); + log_error_errno(errno, "Failed to create entry array file: %m"); r = -errno; goto fail; } @@ -865,7 +865,7 @@ int journal_file_verify( if (show_progress) draw_progress(0x7FFF * p / le64toh(f->header->tail_object_offset), &last_usec); - r = journal_file_move_to_object(f, -1, p, &o); + r = journal_file_move_to_object(f, OBJECT_UNUSED, p, &o); if (r < 0) { error(p, "invalid object"); goto fail; @@ -1085,11 +1085,11 @@ int journal_file_verify( q = last_tag; while (q <= p) { - r = journal_file_move_to_object(f, -1, q, &o); + r = journal_file_move_to_object(f, OBJECT_UNUSED, q, &o); if (r < 0) goto fail; - r = journal_file_hmac_put_object(f, -1, o, q); + r = journal_file_hmac_put_object(f, OBJECT_UNUSED, o, q); if (r < 0) goto fail; @@ -1097,7 +1097,7 @@ int journal_file_verify( } /* Position might have changed, let's reposition things */ - r = journal_file_move_to_object(f, -1, p, &o); + r = journal_file_move_to_object(f, OBJECT_UNUSED, p, &o); if (r < 0) goto fail;