]> git.sur5r.net Git - i3/i3status/commitdiff
Don’t perror("connect") when there most likely is no IPv6 connectivity
authorMichael Stapelberg <michael@stapelberg.de>
Sat, 25 Jul 2009 19:23:39 +0000 (21:23 +0200)
committerMichael Stapelberg <michael@stapelberg.de>
Sat, 25 Jul 2009 19:23:39 +0000 (21:23 +0200)
src/get_ipv6_addr.c

index 2fd978be91f721b1cf322315f91d36c9bfb12004..aa09d3a2ed7e515a18602f2bdef5ed83be21dd6d 100644 (file)
@@ -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) {
                  * 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;
                 }
                         (void)close(fd);
                         continue;
                 }