diff options
author | Pádraig Brady <P@draigBrady.com> | 2017-08-30 00:16:39 -0700 |
---|---|---|
committer | Pádraig Brady <P@draigBrady.com> | 2017-08-30 00:18:10 -0700 |
commit | 58c0514fa38c16ebef9db95e215195570862f872 (patch) | |
tree | e414f9e50200ae3a7827887e7ef52d7c584a2d2e | |
parent | 8d116e3f657cb120f79efbbb675fa3cc9d21f53e (diff) | |
download | gnulib-58c0514fa38c16ebef9db95e215195570862f872.tar.gz |
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.
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | lib/renameat2.h | 2 | ||||
-rw-r--r-- | m4/renameat.m4 | 1 |
3 files changed, 9 insertions, 1 deletions
@@ -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 diff --git a/lib/renameat2.h b/lib/renameat2.h index da3d78c603..f69929ba0c 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 cfbfe15246..1b9777444d 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 |