Re: [BUGS] postmaster.c ,have a warning: pg_getnameinfo_all() failed - Mailing list pgsql-bugs

From Tom Lane
Subject Re: [BUGS] postmaster.c ,have a warning: pg_getnameinfo_all() failed
Date
Msg-id 28845.1489501537@sss.pgh.pa.us
Whole thread Raw
In response to [BUGS] postmaster.c ,have a warning: pg_getnameinfo_all() failed  ("zhaozp@uxsino.com" <zhaozp@uxsino.com>)
List pgsql-bugs
"zhaozp@uxsino.com" <zhaozp@uxsino.com> writes:
> 4075     char        remote_host[NI_MAXHOST];
> 4076     char        remote_port[NI_MAXSERV];
> ...
> 4135     if ((ret = pg_getnameinfo_all(&port->raddr.addr, port->raddr.salen,
> 4136                                   remote_host, sizeof(remote_host),
> 4137                                   remote_port, sizeof(remote_port),
> 4138                  (log_hostname ? 0 : NI_NUMERICHOST) | NI_NUMERICSERV)) != 0)


>      Modified below, correct?
> 4136                                   remote_host, NI_MAXHOST,
> 4137                                   remote_port, NI_MAXSERV,


Why do you think that's an improvement?  The values should be the same,
but the existing code doesn't have a hazard of changing the array size
in one place and failing to change the other.

            regards, tom lane


--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

pgsql-bugs by date:

Previous
From: "zhaozp@uxsino.com"
Date:
Subject: [BUGS] postmaster.c ,have a warning: pg_getnameinfo_all() failed
Next
From: "Wiler Coelho Jr."
Date:
Subject: [BUGS] Error floating-point exception on postgresql installer