summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDr. David Alan Gilbert <dgilbert@redhat.com>2019-09-09 10:14:02 +0100
committerNikolaus Rath <Nikolaus@rath.org>2019-09-09 10:14:02 +0100
commit7c1e09dbc2e4215969425e50ec03889d19a926d4 (patch)
tree3aaf07b544299f9d19a216cdf21ff730913e9e8a
parent317181e8ea1b3406919b946ca5524f8b9f34817d (diff)
passthrough_ll: fix fallocate variant ifdefs (#449)
If fallocate isn't available we incorrectly check for the value of HAVE_POSIX_FALLOCATE rather than it being defined. We also fail to initialise 'err' in the case where neither are defined. Fixes: 5fc562c90d7925963467 ("Add fallocate and use it instead of ...") Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
-rw-r--r--example/passthrough_ll.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/example/passthrough_ll.c b/example/passthrough_ll.c
index f0bc727..fc71784 100644
--- a/example/passthrough_ll.c
+++ b/example/passthrough_ll.c
@@ -928,7 +928,7 @@ static void lo_statfs(fuse_req_t req, fuse_ino_t ino)
static void lo_fallocate(fuse_req_t req, fuse_ino_t ino, int mode,
off_t offset, off_t length, struct fuse_file_info *fi)
{
- int err;
+ int err = EOPNOTSUPP;
(void) ino;
#ifdef HAVE_FALLOCATE
@@ -936,7 +936,7 @@ static void lo_fallocate(fuse_req_t req, fuse_ino_t ino, int mode,
if (err < 0)
err = errno;
-#elif HAVE_POSIX_FALLOCATE
+#elif defined(HAVE_POSIX_FALLOCATE)
if (mode) {
fuse_reply_err(req, EOPNOTSUPP);
return;