]> err.no Git - util-linux/commitdiff
fallocate: fix build failure with old linux headers
authorMike Frysinger <vapier@gentoo.org>
Sun, 3 Oct 2010 20:00:09 +0000 (16:00 -0400)
committerKarel Zak <kzak@redhat.com>
Thu, 7 Oct 2010 07:49:01 +0000 (09:49 +0200)
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>
sys-utils/fallocate.c

index d1f43c24253da968af6610979d04cc5f440b4352..fd4d2a9addbb5f38b16eeea6016089df6acc5623 100644 (file)
 # 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"