From 7a9c524f15c73d66876854e4049c9d4032e22271 Mon Sep 17 00:00:00 2001
From: Pádraig Brady
Date: Wed, 25 Jan 2017 11:09:03 +0000
Subject: build: fix issue with HAVE_FALLOCATE on centos5
* src/copy.c (punch_hole): Work around an empty definition
of HAVE_FALLOCATE which leads to a build error of:
"error: #if with no expression"
That was triggered by the inclusion of in
commit v8.25-68-g89e1fef with kernel-headers-2.6.18.
Reported by Nelson H. F. Beebe
---
src/copy.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/copy.c b/src/copy.c
index c3d71cbc8..e3832c23a 100644
--- a/src/copy.c
+++ b/src/copy.c
@@ -75,6 +75,7 @@
# include
#endif
+/* See HAVE_FALLOCATE workaround when including this file. */
#ifdef HAVE_LINUX_FS_H
# include
#endif
@@ -166,7 +167,8 @@ static int
punch_hole (int fd, off_t offset, off_t length)
{
int ret = 0;
-#if HAVE_FALLOCATE
+/* +0 is to work around older defining HAVE_FALLOCATE to empty. */
+#if HAVE_FALLOCATE + 0
# if defined FALLOC_FL_PUNCH_HOLE && defined FALLOC_FL_KEEP_SIZE
ret = fallocate (fd, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE,
offset, length);
--
cgit v1.2.3-54-g00ecf