]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
Fix compilation warnings about functions declared in sys/xattr.h
authorDmitry V. Levin <ldv@altlinux.org>
Thu, 18 May 2017 17:46:49 +0000 (17:46 +0000)
committerTheodore Ts'o <tytso@mit.edu>
Wed, 13 Dec 2017 04:02:58 +0000 (23:02 -0500)
attr commit v2.4.47-34-g7921157 removes <attr/xattr.h>
and syscall wrappers with the following wording:
"The xattr syscalls are provided by glibc since ages [...]
This removes the need for the <attr/xattr.h> header;
use <sys/xattr.h> instead."

Check for <sys/xattr.h> and include it to fix the following compilation
warnings:

create_inode.c: In function 'set_inode_xattr':
create_inode.c:136:9: warning: implicit declaration of function 'llistxattr' [-Wimplicit-function-declaration]
create_inode.c:172:16: warning: implicit declaration of function 'lgetxattr' [-Wimplicit-function-declaration]

Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
configure
configure.ac
lib/config.h.in
misc/create_inode.c

index 870a7666b7ec9307c939612b0303648baed456fd..06d5fb9377e9feba184cf7bb75752f354a087489 100755 (executable)
--- a/configure
+++ b/configure
@@ -7236,6 +7236,8 @@ main ()
     if (*(data + i) != *(data3 + i))
       return 14;
   close (fd);
+  free (data);
+  free (data3);
   return 0;
 }
 _ACEOF
@@ -12369,7 +12371,7 @@ fi
 done
 
 fi
-for ac_header in       dirent.h        errno.h         execinfo.h      getopt.h        malloc.h        mntent.h        paths.h         semaphore.h     setjmp.h        signal.h        stdarg.h        stdint.h        stdlib.h        termios.h       termio.h        unistd.h        utime.h         attr/xattr.h    linux/falloc.h  linux/fd.h      linux/major.h   linux/loop.h    net/if_dl.h     netinet/in.h    sys/acl.h       sys/disklabel.h         sys/disk.h      sys/file.h      sys/ioctl.h     sys/key.h       sys/mkdev.h     sys/mman.h      sys/mount.h     sys/prctl.h     sys/resource.h  sys/select.h    sys/socket.h    sys/sockio.h    sys/stat.h      sys/syscall.h   sys/sysctl.h    sys/sysmacros.h         sys/time.h      sys/types.h     sys/un.h        sys/wait.h
+for ac_header in       dirent.h        errno.h         execinfo.h      getopt.h        malloc.h        mntent.h        paths.h         semaphore.h     setjmp.h        signal.h        stdarg.h        stdint.h        stdlib.h        termios.h       termio.h        unistd.h        utime.h         attr/xattr.h    linux/falloc.h  linux/fd.h      linux/major.h   linux/loop.h    net/if_dl.h     netinet/in.h    sys/acl.h       sys/disklabel.h         sys/disk.h      sys/file.h      sys/ioctl.h     sys/key.h       sys/mkdev.h     sys/mman.h      sys/mount.h     sys/prctl.h     sys/resource.h  sys/select.h    sys/socket.h    sys/sockio.h    sys/stat.h      sys/syscall.h   sys/sysctl.h    sys/sysmacros.h         sys/time.h      sys/types.h     sys/un.h        sys/wait.h      sys/xattr.h
 do :
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
index dd1668766fe938e611e07e8d0b2e622c8583da00..02e546b8fa7e0f08f89388c0b0ddd1fe9e5d075a 100644 (file)
@@ -944,6 +944,7 @@ AC_CHECK_HEADERS(m4_flatten([
        sys/types.h
        sys/un.h
        sys/wait.h
+       sys/xattr.h
 ]))
 dnl Check where to find a dd(1) that supports iflag=fullblock
 dnl and oflag=append
index bc006deef917443f5de718bbd67dcd0faf257ca5..90d930db9b2ff4fdba3c221b36a60c1a30a92055 100644 (file)
 /* Define to 1 if you have the <sys/wait.h> header file. */
 #undef HAVE_SYS_WAIT_H
 
+/* Define to 1 if you have the <sys/xattr.h> header file. */
+#undef HAVE_SYS_XATTR_H
+
 /* Define to 1 if you have the <termios.h> header file. */
 #undef HAVE_TERMIOS_H
 
index 73dd2f215f89e38e2dce08a72814bf947df9f095..08b4ec28d12287b987c1de7d9c96a44289a03bc8 100644 (file)
@@ -18,7 +18,9 @@
 #include <sys/types.h>
 #include <unistd.h>
 #include <limits.h> /* for PATH_MAX */
-#ifdef HAVE_ATTR_XATTR_H
+#if defined HAVE_SYS_XATTR_H
+#include <sys/xattr.h>
+#elif defined HAVE_ATTR_XATTR_H
 #include <attr/xattr.h>
 #endif
 #include <sys/ioctl.h>