X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fjournal%2Fjournal-file.c;h=5dd6e575fb9fb1f1766cdd85b9e82aa2d6f9e524;hb=96ceff5645faeaf02438d78996b8bdba4ebf05bb;hp=973c51f802e02027c5e391c143497284796d1d36;hpb=5430f7f2bc7330f3088b894166bf3524a067e3d8;p=elogind.git diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c index 973c51f80..5dd6e575f 100644 --- a/src/journal/journal-file.c +++ b/src/journal/journal-file.c @@ -188,6 +188,7 @@ static int journal_file_verify_header(JournalFile *f) { static int journal_file_allocate(JournalFile *f, uint64_t offset, uint64_t size) { uint64_t old_size, new_size; + int r; assert(f); @@ -232,8 +233,9 @@ static int journal_file_allocate(JournalFile *f, uint64_t offset, uint64_t size) /* Note that the glibc fallocate() fallback is very inefficient, hence we try to minimize the allocation area as we can. */ - if (posix_fallocate(f->fd, old_size, new_size - old_size) < 0) - return -errno; + r = posix_fallocate(f->fd, old_size, new_size - old_size); + if (r != 0) + return -r; if (fstat(f->fd, &f->last_stat) < 0) return -errno; @@ -1977,7 +1979,7 @@ int journal_directory_vacuum(const char *directory, uint64_t max_use, uint64_t m size_t q; struct stat st; char *p; - unsigned long long seqnum, realtime; + unsigned long long seqnum = 0, realtime; sd_id128_t seqnum_id; bool have_seqnum;