]> granicus.if.org Git - strace/commitdiff
tests: disable part of msg_name test on non-glibc systems
authorDmitry V. Levin <ldv@altlinux.org>
Thu, 14 Jul 2016 09:37:09 +0000 (09:37 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Thu, 14 Jul 2016 09:37:09 +0000 (09:37 +0000)
Sadly, musl recvmsg wrapper blindly dereferences 2nd argument,
so limit the affected part of the test to glibc that doesn't.

* tests/msg_name.c (test_msg_name) [!__GLIBC__]: Do not test
with inaccessible 2nd argument.

tests/msg_name.c

index 96f902b111d8f1a3202b28c8fe5267ce987dd0c9..c2ddda2ac3d9773927517b120b1e5a640d698ce9 100644 (file)
@@ -120,9 +120,16 @@ test_msg_name(const int send_fd, const int recv_fd)
         * it's ok to fail recvmsg with any reason as long as
         * it doesn't read that inaccessible memory.
         */
+
+       /*
+        * Sadly, musl recvmsg wrapper blindly dereferences 2nd argument,
+        * so limit this test to glibc that doesn't.
+        */
+#ifdef __GLIBC__
        rc = send_recv(send_fd, -1, msg + 1, 0);
        printf("recvmsg(-1, %p, 0) = %d %s (%m)\n",
               msg + 1, rc, errno2name());
+#endif
 
        rc = send_recv(send_fd, -1, 0, 0);
        printf("recvmsg(-1, NULL, 0) = %d %s (%m)\n",