Fix bug failed to create INET domain socket in FreeBSD if listen_addresses = '*'.
authorpengbo <pengbo@sraoss.co.jp>
Tue, 10 Jan 2017 07:59:37 +0000 (16:59 +0900)
committerpengbo <pengbo@sraoss.co.jp>
Tue, 10 Jan 2017 08:08:04 +0000 (17:08 +0900)
per bug202.

src/main/pgpool_main.c

index 2e0b3a7591ec60ed6e183a7819b88719cccd62af..7b1eb310fca7b2f87a61cf08cb29fcb9f8e2d196 100644 (file)
@@ -767,7 +767,7 @@ static int *create_inet_domain_sockets(const char *hostname, const int port)
                        errdetail("asprintf() failed: %s", strerror(errno))));
        }
 
-       if ((ret = getaddrinfo(hostname, portstr, &hints, &res)) != 0)
+       if ((ret = getaddrinfo((!hostname || strcmp(hostname, "*") == 0) ? NULL : hostname, portstr, &hints, &res)) != 0)
        {
                ereport(FATAL,
                        (errmsg("failed to create INET domain socket"),