Skip to content

Commit

Permalink
tests: fix xattr test build
Browse files Browse the repository at this point in the history
Recent releases of attr don't ship attr/xattr.h anymore. It's included
in glibc >= 2.27 as sys/xattr.h. Check for sys/xattr.h and use that if
it exists.
  • Loading branch information
ebfe authored and garlick committed Nov 27, 2018
1 parent d3946ca commit 6fbe656
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions configure.ac
Expand Up @@ -44,6 +44,7 @@ AC_HEADER_STDC
AC_CHECK_HEADERS( \
getopt.h \
pthread.h \
sys/xattr.h \
)

##
Expand Down
6 changes: 5 additions & 1 deletion tests/user/tsetxattr.c
Expand Up @@ -16,7 +16,11 @@
#include <sys/stat.h>
#include <fcntl.h>
#include <libgen.h>
#include <attr/xattr.h>
#if HAVE_SYS_XATTR_H
#include <sys/xattr.h>
#else
#include <attr/xattr.h>
#endif


#include "9p.h"
Expand Down
6 changes: 5 additions & 1 deletion tests/user/txattr.c
Expand Up @@ -13,7 +13,11 @@
#include <inttypes.h>
#include <stdarg.h>
#include <sys/types.h>
#include <attr/xattr.h>
#if HAVE_SYS_XATTR_H
#include <sys/xattr.h>
#else
#include <attr/xattr.h>
#endif
#include <sys/stat.h>
#include <fcntl.h>
#include <libgen.h>
Expand Down

0 comments on commit 6fbe656

Please sign in to comment.