]> xenbits.xensource.com Git - libvirt.git/commitdiff
virportallocatortest: Run on linux only
authorMichal Privoznik <mprivozn@redhat.com>
Fri, 12 Feb 2016 12:48:02 +0000 (13:48 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Fri, 12 Feb 2016 15:13:31 +0000 (16:13 +0100)
After the rework of mocking of our tests there's the
virportallocator test failing to link on mingw. Well, it's the
mocking library actually:

../gnulib/lib/.libs/libgnu.a(bind.o): In function `rpl_bind':
/home/jenkins/libvirt-mingw/build32/gnulib/lib/../../../gnulib/lib/bind.c:33: multiple definition of `rpl_bind'
.libs/virportallocatormock_la-virportallocatormock.o:/home/jenkins/libvirt-mingw/build32/tests/../../tests/virportallocatormock.c:79: first defined here

I've no idea why this matters to mingw and does not to others.
Nevertheless, if we make the test linux only the problem goes
away.

Apparently, our test for RTLD_NEXT is not sufficient because
mingw32 defines it. Lets put aside for a while fact that it has
the same value as RTLD_DEFAULT which by description has different
meaning, shall we?

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
tests/virportallocatormock.c
tests/virportallocatortest.c

index e44191ef7e731c3f675847f2d7f7786106a957f8..fa6e75b2faea87bcf40242a5e98168d498bf0230 100644 (file)
@@ -25,7 +25,7 @@
 # include <dlfcn.h>
 #endif
 
-#if defined(RTLD_NEXT)
+#if defined(__linux__) && defined(RTLD_NEXT)
 # include "internal.h"
 # include <sys/socket.h>
 # include <errno.h>
@@ -105,4 +105,6 @@ int bind(int sockfd ATTRIBUTE_UNUSED,
     return 0;
 }
 
-#endif /* ! defined(RTLD_NEXT) */
+#else /* defined(__linux__) && defined(RTLD_NEXT) */
+/* Nothing to override on other platforms. */
+#endif
index 1a5d759bfa2464d7e352df32cc7d6418e7d862eb..45742153131f3d1c431b8835400a334ee92fae52 100644 (file)
@@ -27,7 +27,8 @@
 # include <dlfcn.h>
 #endif
 
-#if defined(RTLD_NEXT)
+#if defined(__linux__) && defined(RTLD_NEXT)
+
 # include "virutil.h"
 # include "virerror.h"
 # include "viralloc.h"
@@ -174,7 +175,7 @@ mymain(void)
 }
 
 VIRT_TEST_MAIN_PRELOAD(mymain, abs_builddir "/.libs/virportallocatormock.so")
-#else /* ! defined(RTLD_NEXT) */
+#else /* defined(__linux__) && defined(RTLD_NEXT) */
 int
 main(void)
 {