]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
build: Add autoconf check for fsetxattr call
authorJan Tulak <jtulak@redhat.com>
Tue, 13 Oct 2015 23:58:03 +0000 (10:58 +1100)
committerDave Chinner <david@fromorbit.com>
Tue, 13 Oct 2015 23:58:03 +0000 (10:58 +1100)
OS X has fsetxattr() in another header and with different arguments.
For now, check for the Linux variant and if not available, skip
the code using the call.

Signed-off-by: Jan Tulak <jtulak@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
configure.ac
fsr/xfs_fsr.c
include/builddefs.in
m4/package_libcdev.m4

index aa241cd4b657ee469756968947ff048e00325414..5d8486e64913fbfbca756115b19d9fc333c8baf5 100644 (file)
@@ -123,6 +123,7 @@ AC_HAVE_SYNC_FILE_RANGE
 AC_HAVE_MNTENT
 AC_HAVE_FLS
 AC_HAVE_READDIR
+AC_HAVE_FSETXATTR
 
 if test "$enable_blkid" = yes; then
 AC_HAVE_BLKID_TOPO
index b6737614c115784e390ca6ef14fef8b8acd4bb67..e1b7bd6c0330823ec4c1a793ff93df570ae4e8a3 100644 (file)
@@ -1025,6 +1025,7 @@ fsr_setup_attr_fork(
        int             tfd,
        xfs_bstat_t     *bstatp)
 {
+#ifdef HAVE_FSETXATTR
        struct stat64   tstatbuf;
        int             i;
        int             diff = 0;
@@ -1199,6 +1200,7 @@ out:
        if (dflag && diff)
                fsrprintf(_("failed to match fork offset\n"));;
 
+#endif /* HAVE_FSETXATTR */
        return 0;
 }
 
index 6c16a651caffc10eced853c3bfbec2d92bc4da24..25b8816ba75041544bac971c73cadc21b46a3362 100644 (file)
@@ -106,6 +106,7 @@ HAVE_SYNC_FILE_RANGE = @have_sync_file_range@
 HAVE_READDIR = @have_readdir@
 HAVE_MNTENT = @have_mntent@
 HAVE_FLS = @have_fls@
+HAVE_FSETXATTR = @have_fsetxattr@
 
 GCCFLAGS = -funsigned-char -fno-strict-aliasing -Wall 
 #         -Wbitwise -Wno-transparent-union -Wno-old-initializer -Wno-decl
@@ -139,6 +140,9 @@ endif
 ifeq ($(HAVE_MNTENT),yes)
 PCFLAGS+= -DHAVE_MNTENT
 endif
+ifeq ($(HAVE_FSETXATTR),yes)
+PCFLAGS+= -DHAVE_FSETXATTR
+endif
 ifeq ($(ENABLE_BLKID),yes)
 PCFLAGS+= -DENABLE_BLKID
 endif
index 4a963745c74138274f97ac1e7f0837833f6b458a..5e900abe62d13c81ea2144e7a09710f9bfd91e86 100644 (file)
@@ -214,6 +214,19 @@ AC_DEFUN([AC_HAVE_FLS],
     AC_SUBST(have_fls)
   ])
 
+#
+# Check if we have a fsetxattr call (Mac OS X)
+#
+AC_DEFUN([AC_HAVE_FSETXATTR],
+  [ AC_CHECK_DECL([fsetxattr],
+       have_fsetxattr=yes,
+       [],
+       [#include <sys/types.h>
+        #include <attr/xattr.h>]
+       )
+    AC_SUBST(have_fsetxattr)
+  ])
+
 #
 # Check if there is mntent.h
 #