diff options
author | Peter Eisentraut <peter_e@gmx.net> | 2011-08-09 18:28:35 +0300 |
---|---|---|
committer | Peter Eisentraut <peter_e@gmx.net> | 2011-08-09 18:30:32 +0300 |
commit | f4a9da0a150ead846be33c38f665f4337a81054e (patch) | |
tree | 1ef9e989cfd08f373860eeba525ac466376f14a1 /src/backend/utils/adt/network.c | |
parent | 77949a2913b3cbaa7b2e2a73f014d541e251f18b (diff) | |
download | postgresql-f4a9da0a150ead846be33c38f665f4337a81054e.tar.gz postgresql-f4a9da0a150ead846be33c38f665f4337a81054e.zip |
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.
Diffstat (limited to 'src/backend/utils/adt/network.c')
-rw-r--r-- | src/backend/utils/adt/network.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/backend/utils/adt/network.c b/src/backend/utils/adt/network.c index 80e5915b3e5..9aca1cc101f 100644 --- a/src/backend/utils/adt/network.c +++ b/src/backend/utils/adt/network.c @@ -1093,7 +1093,7 @@ inet_client_addr(PG_FUNCTION_ARGS) remote_host, sizeof(remote_host), NULL, 0, NI_NUMERICHOST | NI_NUMERICSERV); - if (ret) + if (ret != 0) PG_RETURN_NULL(); clean_ipv6_addr(port->raddr.addr.ss_family, remote_host); @@ -1132,7 +1132,7 @@ inet_client_port(PG_FUNCTION_ARGS) NULL, 0, remote_port, sizeof(remote_port), NI_NUMERICHOST | NI_NUMERICSERV); - if (ret) + if (ret != 0) PG_RETURN_NULL(); PG_RETURN_DATUM(DirectFunctionCall1(int4in, CStringGetDatum(remote_port))); @@ -1169,7 +1169,7 @@ inet_server_addr(PG_FUNCTION_ARGS) local_host, sizeof(local_host), NULL, 0, NI_NUMERICHOST | NI_NUMERICSERV); - if (ret) + if (ret != 0) PG_RETURN_NULL(); clean_ipv6_addr(port->laddr.addr.ss_family, local_host); @@ -1208,7 +1208,7 @@ inet_server_port(PG_FUNCTION_ARGS) NULL, 0, local_port, sizeof(local_port), NI_NUMERICHOST | NI_NUMERICSERV); - if (ret) + if (ret != 0) PG_RETURN_NULL(); PG_RETURN_DATUM(DirectFunctionCall1(int4in, CStringGetDatum(local_port))); |