From d7de3f3d13cce3efce3659a4aaf86843b4a3c98e Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Thu, 18 May 2017 17:46:49 +0000 Subject: [PATCH] Fix compilation warnings about functions declared in sys/xattr.h attr commit v2.4.47-34-g7921157 removes and syscall wrappers with the following wording: "The xattr syscalls are provided by glibc since ages [...] This removes the need for the header; use instead." Check for 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 Signed-off-by: Theodore Ts'o --- configure | 4 +++- configure.ac | 1 + lib/config.h.in | 3 +++ misc/create_inode.c | 4 +++- 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 870a766..06d5fb9 100755 --- 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" diff --git a/configure.ac b/configure.ac index dd16687..02e546b 100644 --- a/configure.ac +++ b/configure.ac @@ -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 diff --git a/lib/config.h.in b/lib/config.h.in index bc006de..90d930d 100644 --- a/lib/config.h.in +++ b/lib/config.h.in @@ -539,6 +539,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_SYS_WAIT_H +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_XATTR_H + /* Define to 1 if you have the header file. */ #undef HAVE_TERMIOS_H diff --git a/misc/create_inode.c b/misc/create_inode.c index 73dd2f2..08b4ec2 100644 --- a/misc/create_inode.c +++ b/misc/create_inode.c @@ -18,7 +18,9 @@ #include #include #include /* for PATH_MAX */ -#ifdef HAVE_ATTR_XATTR_H +#if defined HAVE_SYS_XATTR_H +#include +#elif defined HAVE_ATTR_XATTR_H #include #endif #include -- 1.8.3.1