From 1ea53aae179f1590a9d255c490b376dae158648e Mon Sep 17 00:00:00 2001 From: Andreas Gruenbacher Date: Mon, 17 Sep 2012 17:01:01 +0200 Subject: Disable xattrs if libattr doesn't implement attr_copy_action() * m4/xattr.m4 (gl_FUNC_XATTR): Only enable USE_XATTR if both attr_copy_file() and attr_copy_action() are defined. * src/util.c (copy_attr_check): No fallback needed if attr_copy_action() is not defined. --- m4/xattr.m4 | 3 ++- src/util.c | 6 ------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/m4/xattr.m4 b/m4/xattr.m4 index 48b08c3..ed26886 100644 --- a/m4/xattr.m4 +++ b/m4/xattr.m4 @@ -30,7 +30,8 @@ AC_DEFUN([gl_FUNC_XATTR], LIB_XATTR=$ac_cv_search_attr_copy_file]) AC_CHECK_FUNCS([attr_copy_file attr_copy_action]) LIBS=$xattr_saved_LIBS - if test $ac_cv_func_attr_copy_file = yes; then + if test $ac_cv_func_attr_copy_file = yes \ + && test $ac_cv_func_attr_copy_action = yes; then use_xattr=yes fi fi diff --git a/src/util.c b/src/util.c index 305e695..7fb6b05 100644 --- a/src/util.c +++ b/src/util.c @@ -196,8 +196,6 @@ copy_attr_free (struct error_context *ctx, char const *str) { } -#ifdef HAVE_ATTR_COPY_ACTION - static int copy_attr_check (const char *name, struct error_context *ctx) { @@ -205,10 +203,6 @@ copy_attr_check (const char *name, struct error_context *ctx) return action == 0 || action == ATTR_ACTION_PERMISSIONS; } -#else -#define copy_attr_check NULL -#endif - static int copy_attr (char const *src_path, char const *dst_path) { -- cgit v1.2.1