mirror of
https://github.com/sheumann/hush.git
synced 2025-01-03 00:31:16 +00:00
make xsocket die with address family printed (if VERBOSE_RESOLUTION_ERRORS=y)
This commit is contained in:
parent
fbf6dea5a2
commit
1d6a4aec2c
@ -540,7 +540,18 @@ int xsocket(int domain, int type, int protocol)
|
|||||||
{
|
{
|
||||||
int r = socket(domain, type, protocol);
|
int r = socket(domain, type, protocol);
|
||||||
|
|
||||||
if (r < 0) bb_perror_msg_and_die("socket");
|
if (r < 0) {
|
||||||
|
/* Hijack vaguely related config option */
|
||||||
|
#if ENABLE_VERBOSE_RESOLUTION_ERRORS
|
||||||
|
const char *s = "INET";
|
||||||
|
if (domain == AF_PACKET) s = "PACKET";
|
||||||
|
if (domain == AF_NETLINK) s = "NETLINK";
|
||||||
|
USE_FEATURE_IPV6(if (domain == AF_INET6) s = "INET6";)
|
||||||
|
bb_perror_msg_and_die("socket(AF_%s)", s);
|
||||||
|
#else
|
||||||
|
bb_perror_msg_and_die("socket");
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user