pgsql: Use AF_UNSPEC not PF_UNSPEC in getaddrinfo calls.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Use AF_UNSPEC not PF_UNSPEC in getaddrinfo calls.
Date: 2014-04-16 17:22:03
Message-ID: E1WaTX9-0001QH-T0@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Use AF_UNSPEC not PF_UNSPEC in getaddrinfo calls.

According to the Single Unix Spec and assorted man pages, you're supposed
to use the constants named AF_xxx when setting ai_family for a getaddrinfo
call. In a few places we were using PF_xxx instead. Use of PF_xxx
appears to be an ancient BSD convention that was not adopted by later
standardization. On BSD and most later Unixen, it doesn't matter much
because those constants have equivalent values anyway; but nonetheless
this code is not per spec.

In the same vein, replace PF_INET by AF_INET in one socket() call, which
wasn't even consistent with the other socket() call in the same function
let alone the remainder of our code.

Per investigation of a Cygwin trouble report from Marco Atzeri. It's
probably a long shot that this will fix his issue, but it's wrong in
any case.

Branch
------
REL8_4_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/7a9bf93e1ca5ffd207da22bce03dfbe1024cd668

Modified Files
--------------
src/backend/libpq/hba.c | 2 +-
src/backend/postmaster/pgstat.c | 2 +-
src/bin/initdb/initdb.c | 2 +-
src/port/pipe.c | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Bruce Momjian 2014-04-16 17:27:46 pgsql: pg_upgrade: remove redundant include files
Previous Message Magnus Hagander 2014-04-16 17:05:54 pgsql: Fix timeout in LDAP lookup of libpq connection parameters