From: Karel Zak Date: Mon, 13 Jan 2014 13:53:18 +0000 (+0100) Subject: fallocate: prefer FALLOC_FL_* flags from libc headers X-Git-Tag: v2.25-rc1~653 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bc5ddf0c0011d1ffc21e29cef9d07420013697b0;p=thirdparty%2Futil-linux.git fallocate: prefer FALLOC_FL_* flags from libc headers Reported-by: Sami Kerola Signed-off-by: Karel Zak --- diff --git a/sys-utils/fallocate.c b/sys-utils/fallocate.c index 6a876736a3..cd35b2d30b 100644 --- a/sys-utils/fallocate.c +++ b/sys-utils/fallocate.c @@ -36,8 +36,9 @@ # include #endif -#ifdef HAVE_LINUX_FALLOC_H -# include /* for FALLOC_FL_* flags */ +#if defined(HAVE_LINUX_FALLOC_H) && \ + (!defined(FALLOC_FL_KEEP_SIZE) || !defined(FALLOC_FL_PUNCH_HOLE)) +# include /* non-libc fallback for FALLOC_FL_* flags */ #endif #ifndef FALLOC_FL_KEEP_SIZE