]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Use AF_UNSPEC not PF_UNSPEC in getaddrinfo calls.
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 16 Apr 2014 17:21:03 +0000 (13:21 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 16 Apr 2014 17:21:35 +0000 (13:21 -0400)
commit9ad94ba08491f3300d54f0df954363ae5fe439d4
treedbf8fa62e6997648e5180723250d3cff84b4828f
parentc4bf15b9c3f80da78e1c5c32c8063c3146f85af8
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.
src/backend/libpq/hba.c
src/backend/port/pipe.c
src/backend/postmaster/pgstat.c
src/bin/initdb/initdb.c