summaryrefslogtreecommitdiffstats
path: root/sys-utils/fallocate.c
diff options
context:
space:
mode:
authorMike Frysinger2010-10-03 22:00:09 +0200
committerKarel Zak2010-10-07 09:49:01 +0200
commitfac8b4bd78cd0f33cf71f4a8525f2f56b5e6b3f2 (patch)
treef3dd0446b2b654f0270e324f59f79750430aa632 /sys-utils/fallocate.c
parentfsck: inform about nonexistent devices in verbose mode (diff)
downloadkernel-qcow2-util-linux-fac8b4bd78cd0f33cf71f4a8525f2f56b5e6b3f2.tar.gz
kernel-qcow2-util-linux-fac8b4bd78cd0f33cf71f4a8525f2f56b5e6b3f2.tar.xz
kernel-qcow2-util-linux-fac8b4bd78cd0f33cf71f4a8525f2f56b5e6b3f2.zip
fallocate: fix build failure with old linux headers
If linux/falloc.h does not exist, the build system still enables the fallocate util, but ultimately fails when it tries to include the header and use a define from it. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'sys-utils/fallocate.c')
-rw-r--r--sys-utils/fallocate.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys-utils/fallocate.c b/sys-utils/fallocate.c
index d1f43c242..fd4d2a9ad 100644
--- a/sys-utils/fallocate.c
+++ b/sys-utils/fallocate.c
@@ -37,7 +37,11 @@
# include <sys/syscall.h>
#endif
-#include <linux/falloc.h> /* for FALLOC_FL_* flags */
+#ifdef HAVE_LINUX_FALLOC_H
+# include <linux/falloc.h> /* for FALLOC_FL_* flags */
+#else
+# define FALLOC_FL_KEEP_SIZE 1
+#endif
#include "nls.h"
#include "strtosize.h"