File dar-use-libc-xattr.patch of Package dar

Index: dar-2.4.20/configure.ac
===================================================================
--- dar-2.4.20.orig/configure.ac
+++ dar-2.4.20/configure.ac
@@ -350,15 +350,15 @@ AC_ARG_ENABLE(  [ea-support],
                 [ AC_MSG_CHECKING([for Extended Attribute support])
                   AC_MSG_RESULT([disabled])
                 ],
-                [ AC_CHECK_HEADERS([attr/xattr.h])
-                  AC_CHECK_LIB(attr, [lgetxattr], [], [])
+                [ AC_CHECK_HEADERS([sys/xattr.h])
+                  AC_SEARCH_LIBS([lgetxattr], [attr])
                   AC_MSG_CHECKING([for Unix Extended Attribute support])
                   AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern "C" {
                                                      #if HAVE_SYS_TYPES_H
                                                      #include <sys/types.h>
                                                      #endif
-                                                     #if HAVE_ATTR_XATTR_H
-                                                     #include <attr/xattr.h>
+                                                     #if HAVE_SYS_XATTR_H
+                                                     #include <sys/xattr.h>
                                                      #endif
                                                     }]],
                                                     [ lgetxattr((char *)0, (char *)0, (void *)0, 0); ])
Index: dar-2.4.20/src/libdar/ea_filesystem.cpp
===================================================================
--- dar-2.4.20.orig/src/libdar/ea_filesystem.cpp
+++ dar-2.4.20/src/libdar/ea_filesystem.cpp
@@ -61,6 +61,10 @@ char *strchr (), *strrchr ();
 #endif
 } // end extern "C"
 
+#ifndef ENOATTR
+# define ENOATTR ENODATA        /* No such attribute */
+#endif
+
 #include "ea_filesystem.hpp"
 #include "ea.hpp"
 #include "tools.hpp"