Hi,
On Wed, Jul 02, 2003 at 03:49:19PM +0900, Kenji Sugita wrote:
> It seems that a value of addr->ai_socktype returned by getaddrinfo in
> pg_stat.c is not SOCK_DGRAM.
Please try the following untested patch:
--- pgstat.c.orig Thu Jun 12 16:36:51 2003
+++ pgstat.c Mon Jul 7 00:34:50 2003
@@ -194,10 +194,12 @@ gai_strerror(ret)); goto startup_failed; }
-
- if ((pgStatSock = socket(addr->ai_family,
- addr->ai_socktype, addr->ai_protocol)) < 0)
- {
+
+ for (; addr != NULL; addr = addr->ai_next)
+ if ((pgStatSock = socket(addr->ai_family,
+ addr->ai_socktype, addr->ai_protocol)) >= 0)
+ break;
+ if (pgStatSock < 0) { elog(LOG, "PGSTAT: socket() failed: %m"); goto startup_failed; }