From: Dr. David Alan Gilbert Date: Mon, 9 Sep 2019 09:14:02 +0000 (+0100) Subject: passthrough_ll: fix fallocate variant ifdefs (#449) X-Git-Tag: fuse-3.7.0~5 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=7c1e09dbc2e4215969425e50ec03889d19a926d4;p=qemu-gpiodev%2Flibfuse.git 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 --- 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;