[Pkg-libvirt-commits] [libguestfs] 12/72: builder: Check HAVE_POSIX_FADVISE before using it

Hilko Bengen bengen at moszumanska.debian.org
Sun Apr 5 15:19:47 UTC 2015


This is an automated email from the git hooks/post-receive script.

bengen pushed a commit to branch master
in repository libguestfs.

commit 23b40dce56eff753e8572192d7b629e0b1b03c56
Author: Margaret Lewicka <margaret at meaningless.name>
Date:   Thu Feb 12 17:28:47 2015 +0000

    builder: Check HAVE_POSIX_FADVISE before using it
    
    (cherry picked from commit bbc8c20a2daf7c1febf970ab8c4a66fff51727c5)
---
 builder/pxzcat-c.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/builder/pxzcat-c.c b/builder/pxzcat-c.c
index 42610c0..17886d6 100644
--- a/builder/pxzcat-c.c
+++ b/builder/pxzcat-c.c
@@ -208,8 +208,10 @@ pxzcat (value filenamev, value outputfilev, unsigned nr_threads)
     unix_error (err, "ftruncate", outputfilev);
   }
 
+#if defined HAVE_POSIX_FADVISE
   /* Tell the kernel we won't read the output file. */
   ignore_value (posix_fadvise (fd, 0, 0, POSIX_FADV_RANDOM|POSIX_FADV_DONTNEED));
+#endif
 
   /* Iterate over blocks. */
   iter_blocks (idx, nr_threads, filenamev, fd, outputfilev, ofd);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libguestfs.git



More information about the Pkg-libvirt-commits mailing list