Re: PostgreSQL 7.4devel - LOG: PGSTAT: socket() failed: Invalid argument

From: qhwt(at)myrealbox(dot)com
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: PostgreSQL 7.4devel - LOG: PGSTAT: socket() failed: Invalid argument
Date: 2003-07-06 15:38:57
Message-ID: 20030706153857.GA1495@myrealbox.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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;
}

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message qhwt 2003-07-06 15:55:06 Re: PostgreSQL 7.4devel - LOG: PGSTAT: socket() failed: Invalid argument
Previous Message Carlos Guzman Alvarez 2003-07-06 15:11:12 Re: Receiving data in binary format how is it encoded?