tests: disable part of msg_name test on non-glibc systems

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.
This commit is contained in:
Дмитрий Левин 2016-07-14 09:37:09 +00:00
parent 4ddbfcfb3c
commit 64a8a4ca3d

View 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",