From 7bb87460e691d30c1a7fd23a1a8240776957e05f Mon Sep 17 00:00:00 2001 From: Michal Schmidt Date: Thu, 5 Nov 2015 13:44:07 +0100 Subject: journal: posix_fallocate() does not set errno manpage says: posix_fallocate() returns zero on success, or an error number on failure. Note that errno is not set. --- src/journal/journald-kmsg.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/journal') diff --git a/src/journal/journald-kmsg.c b/src/journal/journald-kmsg.c index 489f6f689c..c0712b5644 100644 --- a/src/journal/journald-kmsg.c +++ b/src/journal/journald-kmsg.c @@ -442,6 +442,7 @@ fail: int server_open_kernel_seqnum(Server *s) { _cleanup_close_ int fd; uint64_t *p; + int r; assert(s); @@ -455,8 +456,9 @@ int server_open_kernel_seqnum(Server *s) { return 0; } - if (posix_fallocate(fd, 0, sizeof(uint64_t)) < 0) { - log_error_errno(errno, "Failed to allocate sequential number file, ignoring: %m"); + r = posix_fallocate(fd, 0, sizeof(uint64_t)); + if (r != 0) { + log_error_errno(r, "Failed to allocate sequential number file, ignoring: %m"); return 0; } -- cgit v1.2.3-54-g00ecf