]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
fallocate: prefer FALLOC_FL_* flags from libc headers
authorKarel Zak <kzak@redhat.com>
Mon, 13 Jan 2014 13:53:18 +0000 (14:53 +0100)
committerKarel Zak <kzak@redhat.com>
Mon, 13 Jan 2014 13:53:18 +0000 (14:53 +0100)
Reported-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
sys-utils/fallocate.c

index 6a876736a3a05171b054189de933a5ebdbf11683..cd35b2d30be3cc5984d550063ab53b745ba560b0 100644 (file)
@@ -36,8 +36,9 @@
 # include <sys/syscall.h>
 #endif
 
-#ifdef HAVE_LINUX_FALLOC_H
-# include <linux/falloc.h>     /* for FALLOC_FL_* flags */
+#if defined(HAVE_LINUX_FALLOC_H) && \
+    (!defined(FALLOC_FL_KEEP_SIZE) || !defined(FALLOC_FL_PUNCH_HOLE))
+# include <linux/falloc.h>     /* non-libc fallback for FALLOC_FL_* flags */
 #endif
 
 #ifndef FALLOC_FL_KEEP_SIZE