diff options
author | Andreas Gruenbacher <agruen@linbit.com> | 2012-09-14 11:16:49 +0200 |
---|---|---|
committer | Andreas Gruenbacher <agruen@linbit.com> | 2012-09-14 11:39:02 +0200 |
commit | 543906f1a4b15f06ae56e9d735611f3c6559e3dc (patch) | |
tree | e531003d8b3ded66a0e3fefd34db3d703f3e820a | |
parent | f0388d2dbff7903e514f86947f3b7c7e29e674c8 (diff) | |
download | patch-543906f1a4b15f06ae56e9d735611f3c6559e3dc.tar.gz |
Check if libattr implements attr_copy_action()
* m4/xattr.m4 (gl_FUNC_XATTR): Check if attr_copy_action() is defined.
* src/util.c: If attr_copy_action() doesn't exist, fall back to the default
copy_attr_file() behavior of copying most extended attributes except ACLs.
-rw-r--r-- | m4/xattr.m4 | 2 | ||||
-rw-r--r-- | src/util.c | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/m4/xattr.m4 b/m4/xattr.m4 index 7691177..48b08c3 100644 --- a/m4/xattr.m4 +++ b/m4/xattr.m4 @@ -28,7 +28,7 @@ AC_DEFUN([gl_FUNC_XATTR], AC_SEARCH_LIBS([attr_copy_file], [attr], [test "$ac_cv_search_attr_copy_file" = "none required" || LIB_XATTR=$ac_cv_search_attr_copy_file]) - AC_CHECK_FUNCS([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 use_xattr=yes @@ -196,6 +196,8 @@ 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) { @@ -203,6 +205,10 @@ 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) { |