From: Michael Stapelberg Date: Sat, 25 Jul 2009 19:23:39 +0000 (+0200) Subject: Don’t perror("connect") when there most likely is no IPv6 connectivity X-Git-Tag: 2.0~42 X-Git-Url: https://git.sur5r.net/?p=i3%2Fi3status;a=commitdiff_plain;h=94911d4cc3741df95fef45e0cceed1ebc311404b Don’t perror("connect") when there most likely is no IPv6 connectivity --- diff --git a/src/get_ipv6_addr.c b/src/get_ipv6_addr.c index 2fd978b..aa09d3a 100644 --- a/src/get_ipv6_addr.c +++ b/src/get_ipv6_addr.c @@ -41,7 +41,10 @@ const char *get_ipv6_addr() { * it saves the local address with which packets would * be sent to the destination. */ if (connect(fd, resp->ai_addr, resp->ai_addrlen) == -1) { - perror("connect()"); + /* We don’t display the error here because most + * likely, there just is no IPv6 connectivity. + * Thus, don’t spam the user’s console but just + * try the next address. */ (void)close(fd); continue; }