
On 12/16/2014 12:13 PM, Martin Kletzander wrote:
When any of the functions modified in commit 214c687b took false branch, the function itself used none of its parameters resulting in "unused parameter" error. Rewriting these functions to the stubs we use elsewhere should fix the problem.
Signed-off-by: Martin Kletzander <mkletzan@redhat.com> --- src/util/virfile.c | 38 +++++++++++++++++++++++++++++++------- 1 file changed, 31 insertions(+), 7 deletions(-)
diff --git a/src/util/virfile.c b/src/util/virfile.c index 4483cce..2076860 100644 --- a/src/util/virfile.c +++ b/src/util/virfile.c @@ -1037,36 +1037,52 @@ safewrite(int fd, const void *buf, size_t count) return nwritten; }
+#ifdef HAVE_POSIX_FALLOCATE static int safezero_posix_fallocate(int fd, off_t offset, off_t len) { -#ifdef HAVE_POSIX_FALLOCATE int ret = posix_fallocate(fd, offset, len); if (ret == 0) return 0; errno = ret; -#endif return -1; } +#else /* !HAVE_POSIX_FALLOCATE */ +static int +safezero_posix_fallocate(int fd ATTRIBUTE_UNUSED, + off_t offset ATTRIBUTE_UNUSED, + off_t len ATTRIBUTE_UNUSED) +{ + return -1;
Odd that we don't set errno on the fallback, but it's pre-existing, so not a problem in your patch.
+safezero_mmap(int fd ATTRIBUTE_UNUSED, + off_t offset ATTRIBUTE_UNUSED, + off_t lenATTRIBUTE_UNUSED)
Missing a space; you'd still get a warning that 'lenATTRIBUTE_UNUSED' is not marked unused :) ACK with the space added. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org