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 07:59:37 +0000 (16:59 +0900)
per bug202.

src/main/pgpool_main.c

index f633bba5eb017a09c4a59dc531b3e73823f20aca..5b769908dce0e90c6a1161171b8eea5756c6dd5d 100644 (file)
@@ -805,7 +805,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"),