]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
build-sys: always check for setns() and unshare() libs functions
authorKarel Zak <kzak@redhat.com>
Tue, 21 May 2013 09:32:29 +0000 (11:32 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 21 May 2013 09:32:29 +0000 (11:32 +0200)
 $ ./configure --disable-unshare
 $ make nsenter

  CC       sys-utils/nsenter.o
In file included from sys-utils/nsenter.c:36:0:
./include/namespace.h:31:19: error: static declaration of ‘unshare’ follows non-static declaration
In file included from /usr/include/sched.h:42:0,
                 from sys-utils/nsenter.c:23:
/usr/include/bits/sched.h:86:12: note: previous declaration of ‘unshare’ was here
make: *** [sys-utils/nsenter.o] Error 1

We have to always check for the libc function independently on
--disable-{unshare,nsenter} to avoid collision between local and libc
declarations.

Reported-by: "Gabor Z. Papp" <gzp@papp.hu>
Signed-off-by: Karel Zak <kzak@redhat.com>
configure.ac

index dad0439a38fbfe65cd6d9211c5284388acbb8621..9414e6ac43e66139f16cd9d5931ef08d4c223301 100644 (file)
@@ -905,9 +905,7 @@ UL_BUILD_INIT([unshare])
 UL_REQUIRES_LINUX([unshare])
 UL_REQUIRES_SYSCALL_CHECK([unshare], [UL_CHECK_SYSCALL([unshare])])
 AM_CONDITIONAL(BUILD_UNSHARE, test "x$build_unshare" = xyes)
-if test "x$build_unshare" = xyes; then
-  AC_CHECK_FUNCS([unshare])
-fi
+AC_CHECK_FUNCS([unshare])
 
 AC_ARG_ENABLE([nsenter],
   AS_HELP_STRING([--disable-nsenter], [do not build nsenter]),
@@ -917,9 +915,7 @@ UL_BUILD_INIT([nsenter])
 UL_REQUIRES_LINUX([nsenter])
 UL_REQUIRES_SYSCALL_CHECK([nsenter], [UL_CHECK_SYSCALL([setns])], [setns])
 AM_CONDITIONAL(BUILD_NSENTER, test "x$build_nsenter" = xyes)
-if test "x$build_nsenter" = xyes; then
-  AC_CHECK_FUNCS([setns])
-fi
+AC_CHECK_FUNCS([setns])
 
 dnl setpriv depends on libcap-ng.  It would be possible to build
 dnl a version of setpriv with limited functionality without libcap-ng,