n = res_search (name, C_IN, type, host_buffer.buf, sizeof (host_buffer));
if (n < 0)
- return errno == ECONNREFUSED ? NSS_STATUS_UNAVAIL : NSS_STATUS_NOTFOUND;
+ return (errno == ECONNREFUSED
+ || errno == EPFNOSUPPORT
+ || errno == EAFNOSUPPORT)
+ ? NSS_STATUS_UNAVAIL : NSS_STATUS_NOTFOUND;
return getanswer_r (&host_buffer, n, name, type, result, buffer, buflen,
h_errnop);
n = res_query (qbuf, C_IN, T_PTR, (u_char *)host_buffer.buf,
sizeof host_buffer);
if (n < 0)
- return errno == ECONNREFUSED ? NSS_STATUS_UNAVAIL : NSS_STATUS_NOTFOUND;
+ return (errno == ECONNREFUSED
+ || errno == EPFNOSUPPORT
+ || errno == EAFNOSUPPORT)
+ ? NSS_STATUS_UNAVAIL : NSS_STATUS_NOTFOUND;
status = getanswer_r (&host_buffer, n, qbuf, T_PTR, result, buffer, buflen,
h_errnop);
sizeof (querybuf));
if (anslen < 0)
/* Nothing found. */
- return errno == ECONNREFUSED ? NSS_STATUS_UNAVAIL : NSS_STATUS_NOTFOUND;
+ return (errno == ECONNREFUSED
+ || errno == EPFNOSUPPORT
+ || errno == EAFNOSUPPORT)
+ ? NSS_STATUS_UNAVAIL : NSS_STATUS_NOTFOUND;
return getanswer_r (&net_buffer, anslen, result, buffer, buflen, BYNAME);
}
sizeof (querybuf));
if (anslen < 0)
/* Nothing found. */
- return errno == ECONNREFUSED ? NSS_STATUS_UNAVAIL : NSS_STATUS_NOTFOUND;
+ return (errno == ECONNREFUSED
+ || errno == EPFNOSUPPORT
+ || errno == EAFNOSUPPORT)
+ ? NSS_STATUS_UNAVAIL : NSS_STATUS_NOTFOUND;
status = getanswer_r (&net_buffer, anslen, result, buffer, buflen, BYADDR);
if (status == NSS_STATUS_SUCCESS)
err = __socket_create (server, type, protocol, &sock);
}
+ /* These errors all mean that the server node doesn't support the
+ socket.defs protocol, which we'll take to mean that the protocol
+ isn't supported. */
+ if (err == MACH_SEND_INVALID_DEST || err == MIG_SERVER_DIED
+ || err == MIG_BAD_ID || err == EOPNOTSUPP)
+ err = EPFNOSUPPORT;
+
if (err)
return __hurd_fail (err);