mirror of
https://github.com/sheumann/hush.git
synced 2024-12-21 23:29:34 +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);
|
||||
|
||||
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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user