RHEL 5: header was called <sys/xattr.h>

This commit is contained in:
Richard W.M. Jones
2009-07-14 14:34:57 +01:00
parent 74ee9390d3
commit 72c6cc02e2
2 changed files with 10 additions and 3 deletions

View File

@@ -66,7 +66,7 @@ dnl Functions which may not be available in older distributions.
AC_CHECK_FUNCS([futimens listxattr llistxattr getxattr lgetxattr setxattr lsetxattr removexattr lremovexattr])
dnl Headers.
AC_CHECK_HEADERS([attr/xattr.h])
AC_CHECK_HEADERS([attr/xattr.h sys/xattr.h])
dnl Produce output files.
AC_CONFIG_HEADERS([config.h])

View File

@@ -25,8 +25,15 @@
#include "daemon.h"
#include "actions.h"
#if defined(HAVE_ATTR_XATTR_H) || defined(HAVE_SYS_XATTR_H)
#ifdef HAVE_ATTR_XATTR_H
#include <attr/xattr.h>
#else
#ifdef HAVE_SYS_XATTR_H
#include <sys/xattr.h>
#endif
#endif
static guestfs_int_xattr_list *getxattrs (char *path, ssize_t (*listxattr) (const char *path, char *list, size_t size), ssize_t (*getxattr) (const char *path, const char *name, void *value, size_t size));
static int _setxattr (char *xattr, char *val, int vallen, char *path, int (*setxattr) (const char *path, const char *name, const void *value, size_t size, int flags));
@@ -237,7 +244,7 @@ _removexattr (char *xattr, char *path,
return 0;
}
#else /* !HAVE_ATTR_XATTR_H */
#else /* no xattr.h */
guestfs_int_xattr_list *
do_getxattrs (char *path)
@@ -281,4 +288,4 @@ do_lremovexattr (char *xattr, char *path)
return -1;
}
#endif /* !HAVE_ATTR_XATTR_H */
#endif /* no xattr.h */