diff options
author | Andreas Gruenbacher <andreas.gruenbacher@gmail.com> | 2015-04-28 12:01:19 +0200 |
---|---|---|
committer | Andreas Gruenbacher <andreas.gruenbacher@gmail.com> | 2015-05-27 23:37:50 +0200 |
commit | f1b37e3afb1ba17be1c11012f86ff14e5cc357af (patch) | |
tree | 6923deb126e9991040dee1214151567f20630411 /m4/acl.m4 | |
parent | 70e0e9ed738ddc514b09fa486421fc86c31c7e25 (diff) | |
download | gnulib-f1b37e3afb1ba17be1c11012f86ff14e5cc357af.tar.gz |
file-has-acl: Split feature tests again (Bug#20667)
* lib/file-has-acl.c: Instead of testing for
XATTR_NAME_POSIX_ACL_ACCESS and XATTR_NAME_POSIX_ACL_DEFAULT,
define them when needed.
* m4/acl.m4 (gl_FILE_HAS_ACL): With that, Paul's
GETXATTR_WITH_POSIX_ACLS change shouldn't be needed anymore.
Diffstat (limited to 'm4/acl.m4')
-rw-r--r-- | m4/acl.m4 | 24 |
1 files changed, 5 insertions, 19 deletions
@@ -1,5 +1,5 @@ # acl.m4 - check for access control list (ACL) primitives -# serial 19 +# serial 20 # Copyright (C) 2002, 2004-2015 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation @@ -181,26 +181,12 @@ AC_DEFUN([gl_FILE_HAS_ACL], [ AC_REQUIRE([gl_FUNC_ACL_ARG]) if test "$enable_acl" != no; then - AC_CACHE_CHECK([for getxattr with XATTR_NAME_POSIX_ACL macros], - [gl_cv_getxattr_with_posix_acls], - [gl_cv_getxattr_with_posix_acls=no - AC_LINK_IFELSE( - [AC_LANG_PROGRAM( - [[#include <sys/types.h> - #include <sys/xattr.h> - #include <linux/xattr.h> - ]], - [[ssize_t a = getxattr (".", XATTR_NAME_POSIX_ACL_ACCESS, 0, 0); - ssize_t b = getxattr (".", XATTR_NAME_POSIX_ACL_DEFAULT, 0, 0); - return a < 0 || b < 0; - ]])], - [gl_cv_getxattr_with_posix_acls=yes])]) + AC_CHECK_HEADERS([linux/xattr.h]) + AC_CHECK_HEADERS([sys/xattr.h], + [AC_CHECK_FUNCS([getxattr])]) fi - if test "$gl_cv_getxattr_with_posix_acls" = yes; then + if test "$ac_cv_header_sys_xattr_h,$ac_cv_func_getxattr" = yes,yes; then LIB_HAS_ACL= - AC_DEFINE([GETXATTR_WITH_POSIX_ACLS], 1, - [Define to 1 if getxattr works with XATTR_NAME_POSIX_ACL_ACCESS - and XATTR_NAME_POSIX_ACL_DEFAULT.]) else dnl Set gl_need_lib_has_acl to a nonempty value, so that any dnl later gl_FUNC_ACL call will set LIB_HAS_ACL=$LIB_ACL. |