aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277>2007-04-13 21:26:20 +0000
committervda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277>2007-04-13 21:26:20 +0000
commitcdd37f63489b78a651ff22677f56cb3ad00497f2 (patch)
tree323221fc8ddb27e44d39c8b329bd20a5166675f9
parentc9993148c0cd5c3234163a1ba6f8e9dad1c9e31a (diff)
downloadbusybox-w32-cdd37f63489b78a651ff22677f56cb3ad00497f2.tar.gz
busybox-w32-cdd37f63489b78a651ff22677f56cb3ad00497f2.tar.bz2
busybox-w32-cdd37f63489b78a651ff22677f56cb3ad00497f2.zip
make xsocket die with address family printed (if VERBOSE_RESOLUTION_ERRORS=y)
git-svn-id: svn://busybox.net/trunk/busybox@18431 69ca8d6d-28ef-0310-b511-8ec308f3f277
-rw-r--r--libbb/xfuncs.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/libbb/xfuncs.c b/libbb/xfuncs.c
index 7fe5c3a45..7e1109470 100644
--- a/libbb/xfuncs.c
+++ b/libbb/xfuncs.c
@@ -540,7 +540,18 @@ int xsocket(int domain, int type, int protocol)
540{ 540{
541 int r = socket(domain, type, protocol); 541 int r = socket(domain, type, protocol);
542 542
543 if (r < 0) bb_perror_msg_and_die("socket"); 543 if (r < 0) {
544 /* Hijack vaguely related config option */
545#if ENABLE_VERBOSE_RESOLUTION_ERRORS
546 const char *s = "INET";
547 if (domain == AF_PACKET) s = "PACKET";
548 if (domain == AF_NETLINK) s = "NETLINK";
549USE_FEATURE_IPV6(if (domain == AF_INET6) s = "INET6";)
550 bb_perror_msg_and_die("socket(AF_%s)", s);
551#else
552 bb_perror_msg_and_die("socket");
553#endif
554 }
544 555
545 return r; 556 return r;
546} 557}