]> xenbits.xensource.com Git - libvirt.git/commitdiff
Fix include for xattr.h
authorMartin Kletzander <mkletzan@redhat.com>
Fri, 3 Aug 2018 14:35:53 +0000 (16:35 +0200)
committerMartin Kletzander <mkletzan@redhat.com>
Mon, 6 Aug 2018 09:50:53 +0000 (11:50 +0200)
The proper file that should be included is `sys/xattr.h` as that comes from
`glibc` and not `attr/xattr.h` which ships with the `attr` utility.

We're most probably not the only ones because `attr/xattr.h` added a #warning to
their include resulting in the following compilation errors:

In file included from securityselinuxlabeltest.c:31:0:
/usr/include/attr/xattr.h:5:2: error: #warning "Please change your <attr/xattr.h> includes to <sys/xattr.h>" [-Werror=cpp]
 #warning "Please change your <attr/xattr.h> includes to <sys/xattr.h>"
  ^~~~~~~

In file included from securityselinuxhelper.c:37:0:
/usr/include/attr/xattr.h:5:2: error: #warning "Please change your <attr/xattr.h> includes to <sys/xattr.h>" [-Werror=cpp]
 #warning "Please change your <attr/xattr.h> includes to <sys/xattr.h>"
  ^~~~~~~

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
m4/virt-attr.m4
tests/securityselinuxhelper.c
tests/securityselinuxlabeltest.c

index c55bd7dbd8230f1e9679f1370e9b0f3042ddcb82..478549c17f12e33afbc5c91f37a88288d14f4840 100644 (file)
@@ -5,7 +5,7 @@ AC_DEFUN([LIBVIRT_ARG_ATTR],[
 ])
 
 AC_DEFUN([LIBVIRT_CHECK_ATTR],[
-  LIBVIRT_CHECK_LIB([ATTR], [attr], [getxattr], [attr/xattr.h])
+  LIBVIRT_CHECK_LIB([ATTR], [attr], [getxattr], [sys/xattr.h])
 ])
 
 AC_DEFUN([LIBVIRT_RESULT_ATTR],[
index 22b6709554b43be328f7a0c54aa9f3586813380a..fe6f2b5fd9b07e654b2ac58903ecb727e32d768d 100644 (file)
@@ -34,7 +34,7 @@
 #include <string.h>
 #include <sys/vfs.h>
 #include <unistd.h>
-#include <attr/xattr.h>
+#include <sys/xattr.h>
 
 #ifndef NFS_SUPER_MAGIC
 # define NFS_SUPER_MAGIC 0x6969
index c684989fd26eb99a41d4dc9801e102be2431d00c..48fee7cd285b5880a48a5b10a7a4f77bfcbd912a 100644 (file)
@@ -28,7 +28,7 @@
 
 #include <selinux/selinux.h>
 #include <selinux/context.h>
-#include <attr/xattr.h>
+#include <sys/xattr.h>
 
 #include "internal.h"
 #include "testutils.h"