Improved the bind()-failure message to mention what family failed.
authorWayne Davison <wayned@samba.org>
Sun, 2 Apr 2006 21:15:37 +0000 (21:15 +0000)
committerWayne Davison <wayned@samba.org>
Sun, 2 Apr 2006 21:15:37 +0000 (21:15 +0000)
socket.c

index 9079093..8570bd2 100644 (file)
--- a/socket.c
+++ b/socket.c
@@ -394,7 +394,8 @@ static int *open_socket_in(int type, int port, const char *bind_addr,
                if (bind(s, resp->ai_addr, resp->ai_addrlen) < 0) {
                        /* Nope, try another */
                        int r = asprintf(&errmsgs[ecnt++],
                if (bind(s, resp->ai_addr, resp->ai_addrlen) < 0) {
                        /* Nope, try another */
                        int r = asprintf(&errmsgs[ecnt++],
-                               "bind() failed: %s\n", strerror(errno));
+                               "bind() failed: %s (address-family %d)\n",
+                               strerror(errno), (int)resp->ai_family);
                        if (r < 0)
                                out_of_memory("open_socket_in");
                        close(s);
                        if (r < 0)
                                out_of_memory("open_socket_in");
                        close(s);