]> Savannah Git Hosting - gnulib.git/commitdiff
renameat2: fix compilation on alpine linux
authorPádraig Brady <P@draigBrady.com>
Wed, 30 Aug 2017 07:16:39 +0000 (00:16 -0700)
committerPádraig Brady <P@draigBrady.com>
Wed, 30 Aug 2017 07:18:10 +0000 (00:18 -0700)
* 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
lib/renameat2.h
m4/renameat.m4

index 994123a6e0df67865a61bf2b81121a1a3d382d56..0b3c06ac837bff5f95055a0a5d18ac74c17a2688 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2017-08-30  Pádraig Brady  <P@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  <eggert@cs.ucla.edu>
 
        glob: try to port recent changes to MS-Windows
index da3d78c60399f0f40744e5f398914cbbade80662..f69929ba0c169b5f7dc436a7297af74f0515a598 100644 (file)
@@ -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
index cfbfe15246d0ac56325fedca802bec8ae70db452..1b9777444d2cb07915d68ed3b141f668f46cecf0 100644 (file)
@@ -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