diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-04-13 21:26:20 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-04-13 21:26:20 +0000 |
commit | 1d6a4aec2cbe09ba21a6b5f8dc5dec7d341f7ba1 (patch) | |
tree | 323221fc8ddb27e44d39c8b329bd20a5166675f9 /libbb | |
parent | fbf6dea5a288362564c4ab4859a1018e1f2dcde4 (diff) | |
download | busybox-w32-1d6a4aec2cbe09ba21a6b5f8dc5dec7d341f7ba1.tar.gz busybox-w32-1d6a4aec2cbe09ba21a6b5f8dc5dec7d341f7ba1.tar.bz2 busybox-w32-1d6a4aec2cbe09ba21a6b5f8dc5dec7d341f7ba1.zip |
make xsocket die with address family printed (if VERBOSE_RESOLUTION_ERRORS=y)
Diffstat (limited to 'libbb')
-rw-r--r-- | libbb/xfuncs.c | 13 |
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"; | ||
549 | USE_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 | } |