Discussion:
[PATCH] renameat2: fix compilation on alpine linux
(too old to reply)
Pádraig Brady
2017-08-30 07:18:45 UTC
Permalink
Raw Message
* m4/renameat.m4: Check for <linux/fs.h> presence.
* lib/renameat2.h: Only include <linux/fs.h> if present.
Reported by Assaf Gordon on Alpine Linux.
---
ChangeLog | 7 +++++++
lib/renameat2.h | 2 +-
m4/renameat.m4 | 1 +
3 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 994123a..0b3c06a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2017-08-30 Pádraig Brady <***@draigBrady.com>
+
+ renameat2: fix compilation on alpine linux
+ * m4/renameat.m4: Check for <linux/fs.h> presence.
+ * lib/renameat2.h: Only include <linux/fs.h> if present.
+ Reported by Assaf Gordon on Alpine Linux.
+
2017-08-24 Paul Eggert <***@cs.ucla.edu>

glob: try to port recent changes to MS-Windows
diff --git a/lib/renameat2.h b/lib/renameat2.h
index da3d78c..f69929b 100644
--- a/lib/renameat2.h
+++ b/lib/renameat2.h
@@ -18,7 +18,7 @@

/* Get RENAME_* macros from linux/fs.h if present, otherwise supply
the traditional Linux values. */
-#ifdef __linux__
+#if HAVE_LINUX_FS_H
# include <linux/fs.h>
#endif
#ifndef RENAME_NOREPLACE
diff --git a/m4/renameat.m4 b/m4/renameat.m4
index cfbfe15..1b97774 100644
--- a/m4/renameat.m4
+++ b/m4/renameat.m4
@@ -14,6 +14,7 @@ AC_DEFUN([gl_FUNC_RENAMEAT],
AC_REQUIRE([gl_FUNC_RENAME])
AC_REQUIRE([gl_STDIO_H_DEFAULTS])
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+ AC_CHECK_HEADERS([linux/fs.h])
AC_CHECK_FUNCS_ONCE([renameat])
if test $ac_cv_func_renameat = no; then
HAVE_RENAMEAT=0
--
2.9.3
Loading...