Re: [BUGS] postmaster.c ,have a warning: pg_getnameinfo_all() failed

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [BUGS] postmaster.c ,have a warning: pg_getnameinfo_all() failed
Дата
Msg-id 28845.1489501537@sss.pgh.pa.us
обсуждение исходный текст
Ответ на [BUGS] postmaster.c ,have a warning: pg_getnameinfo_all() failed  ("zhaozp@uxsino.com" <zhaozp@uxsino.com>)
Список 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 по дате отправления:

Предыдущее
От: "zhaozp@uxsino.com"
Дата:
Сообщение: [BUGS] postmaster.c ,have a warning: pg_getnameinfo_all() failed
Следующее
От: "Wiler Coelho Jr."
Дата:
Сообщение: [BUGS] Error floating-point exception on postgresql installer