1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-17 01:02:17 +03:00

Use clearer notation for getnameinfo() return handling

Writing

    if (getnameinfo(...))
        handle_error();

reads quite strangely, so use something like

    if (getnameinfo(...) != 0)
        handle_error();

instead.
This commit is contained in:
Peter Eisentraut
2011-08-09 18:28:35 +03:00
parent 77949a2913
commit f4a9da0a15
4 changed files with 16 additions and 16 deletions

View File

@@ -569,7 +569,7 @@ check_hostname(hbaPort *port, const char *hostname)
if (pg_getnameinfo_all(&port->raddr.addr, port->raddr.salen,
remote_hostname, sizeof(remote_hostname),
NULL, 0,
0))
0) != 0)
return false;
port->remote_hostname = pstrdup(remote_hostname);