@@ -409,7 +409,7 @@ StreamServerPort(int family, const char *hostName, unsigned short portNumber,
409
409
410
410
for (addr = addrs ; addr ; addr = addr -> ai_next )
411
411
{
412
- if (! IS_AF_UNIX ( family ) && IS_AF_UNIX ( addr -> ai_family ) )
412
+ if (family != AF_UNIX && addr -> ai_family == AF_UNIX )
413
413
{
414
414
/*
415
415
* Only set up a unix domain socket when they really asked for it.
@@ -494,7 +494,7 @@ StreamServerPort(int family, const char *hostName, unsigned short portNumber,
494
494
* unpredictable behavior. With no flags at all, win32 behaves as Unix
495
495
* with SO_REUSEADDR.
496
496
*/
497
- if (! IS_AF_UNIX ( addr -> ai_family ) )
497
+ if (addr -> ai_family != AF_UNIX )
498
498
{
499
499
if ((setsockopt (fd , SOL_SOCKET , SO_REUSEADDR ,
500
500
(char * ) & one , sizeof (one ))) == -1 )
@@ -546,7 +546,7 @@ StreamServerPort(int family, const char *hostName, unsigned short portNumber,
546
546
errmsg ("could not bind %s address \"%s\": %m" ,
547
547
familyDesc , addrDesc ),
548
548
saved_errno == EADDRINUSE ?
549
- (IS_AF_UNIX ( addr -> ai_family ) ?
549
+ (addr -> ai_family == AF_UNIX ?
550
550
errhint ("Is another postmaster already running on port %d?" ,
551
551
(int ) portNumber ) :
552
552
errhint ("Is another postmaster already running on port %d?"
@@ -764,7 +764,7 @@ StreamConnection(pgsocket server_fd, Port *port)
764
764
}
765
765
766
766
/* select NODELAY and KEEPALIVE options if it's a TCP connection */
767
- if (! IS_AF_UNIX ( port -> laddr .addr .ss_family ) )
767
+ if (port -> laddr .addr .ss_family != AF_UNIX )
768
768
{
769
769
int on ;
770
770
#ifdef WIN32
@@ -1639,7 +1639,7 @@ int
1639
1639
pq_getkeepalivesidle (Port * port )
1640
1640
{
1641
1641
#if defined(PG_TCP_KEEPALIVE_IDLE ) || defined(SIO_KEEPALIVE_VALS )
1642
- if (port == NULL || IS_AF_UNIX ( port -> laddr .addr .ss_family ) )
1642
+ if (port == NULL || port -> laddr .addr .ss_family == AF_UNIX )
1643
1643
return 0 ;
1644
1644
1645
1645
if (port -> keepalives_idle != 0 )
@@ -1673,7 +1673,7 @@ pq_getkeepalivesidle(Port *port)
1673
1673
int
1674
1674
pq_setkeepalivesidle (int idle , Port * port )
1675
1675
{
1676
- if (port == NULL || IS_AF_UNIX ( port -> laddr .addr .ss_family ) )
1676
+ if (port == NULL || port -> laddr .addr .ss_family == AF_UNIX )
1677
1677
return STATUS_OK ;
1678
1678
1679
1679
/* check SIO_KEEPALIVE_VALS here, not just WIN32, as some toolchains lack it */
@@ -1724,7 +1724,7 @@ int
1724
1724
pq_getkeepalivesinterval (Port * port )
1725
1725
{
1726
1726
#if defined(TCP_KEEPINTVL ) || defined(SIO_KEEPALIVE_VALS )
1727
- if (port == NULL || IS_AF_UNIX ( port -> laddr .addr .ss_family ) )
1727
+ if (port == NULL || port -> laddr .addr .ss_family == AF_UNIX )
1728
1728
return 0 ;
1729
1729
1730
1730
if (port -> keepalives_interval != 0 )
@@ -1758,7 +1758,7 @@ pq_getkeepalivesinterval(Port *port)
1758
1758
int
1759
1759
pq_setkeepalivesinterval (int interval , Port * port )
1760
1760
{
1761
- if (port == NULL || IS_AF_UNIX ( port -> laddr .addr .ss_family ) )
1761
+ if (port == NULL || port -> laddr .addr .ss_family == AF_UNIX )
1762
1762
return STATUS_OK ;
1763
1763
1764
1764
#if defined(TCP_KEEPINTVL ) || defined(SIO_KEEPALIVE_VALS )
@@ -1808,7 +1808,7 @@ int
1808
1808
pq_getkeepalivescount (Port * port )
1809
1809
{
1810
1810
#ifdef TCP_KEEPCNT
1811
- if (port == NULL || IS_AF_UNIX ( port -> laddr .addr .ss_family ) )
1811
+ if (port == NULL || port -> laddr .addr .ss_family == AF_UNIX )
1812
1812
return 0 ;
1813
1813
1814
1814
if (port -> keepalives_count != 0 )
@@ -1837,7 +1837,7 @@ pq_getkeepalivescount(Port *port)
1837
1837
int
1838
1838
pq_setkeepalivescount (int count , Port * port )
1839
1839
{
1840
- if (port == NULL || IS_AF_UNIX ( port -> laddr .addr .ss_family ) )
1840
+ if (port == NULL || port -> laddr .addr .ss_family == AF_UNIX )
1841
1841
return STATUS_OK ;
1842
1842
1843
1843
#ifdef TCP_KEEPCNT
@@ -1883,7 +1883,7 @@ int
1883
1883
pq_gettcpusertimeout (Port * port )
1884
1884
{
1885
1885
#ifdef TCP_USER_TIMEOUT
1886
- if (port == NULL || IS_AF_UNIX ( port -> laddr .addr .ss_family ) )
1886
+ if (port == NULL || port -> laddr .addr .ss_family == AF_UNIX )
1887
1887
return 0 ;
1888
1888
1889
1889
if (port -> tcp_user_timeout != 0 )
@@ -1912,7 +1912,7 @@ pq_gettcpusertimeout(Port *port)
1912
1912
int
1913
1913
pq_settcpusertimeout (int timeout , Port * port )
1914
1914
{
1915
- if (port == NULL || IS_AF_UNIX ( port -> laddr .addr .ss_family ) )
1915
+ if (port == NULL || port -> laddr .addr .ss_family == AF_UNIX )
1916
1916
return STATUS_OK ;
1917
1917
1918
1918
#ifdef TCP_USER_TIMEOUT
0 commit comments