summaryrefslogtreecommitdiff
path: root/src/journal/journal-file.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/journal/journal-file.c')
-rw-r--r--src/journal/journal-file.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c
index a60a896c2f..5dd6e575fb 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;