(CMSG_FIRSTHDR, __cmsg_nxthdr): Use (struct cmsghdr *) 0 instead of
NULL.
* bits/socket.h: Likewise.
+ * support/resolv_test.c (server_thread_udp_process_one): Call recvfrom
+ instead of xrecvfrom, and ignore ECONNREFUSED errors.
2017-09-22 Joseph Myers <joseph@codesourcery.com>
unsigned char query[512];
struct sockaddr_storage peer;
socklen_t peerlen = sizeof (peer);
- size_t length = xrecvfrom (obj->servers[server_index].socket_udp,
+ ssize_t length = recvfrom (obj->servers[server_index].socket_udp,
query, sizeof (query), 0,
(struct sockaddr *) &peer, &peerlen);
/* Check for termination. */
return false;
}
+ if (length < 0)
+ {
+ /* The other end had closed the socket, and we are notified only now. */
+ TEST_VERIFY_EXIT (errno == ECONNREFUSED);
+ return true;
+ }
struct query_info qinfo;
parse_query (&qinfo, query, length);