summaryrefslogtreecommitdiff
path: root/src/backend/libpq
diff options
context:
space:
mode:
authorPeter Eisentraut2021-11-09 14:20:47 +0000
committerPeter Eisentraut2021-11-09 14:35:26 +0000
commitee3a1a5b636b69dde33d68c428dd56b3389a4538 (patch)
tree6943325f2baa9e3e70994b3edd79ea5534ed6ba7 /src/backend/libpq
parent4cd046c203bbca2955182f78eabc06e831ffdbb1 (diff)
Remove check for accept() argument types
This check was used to accommodate a staggering variety in particular in the type of the third argument of accept(). This is no longer of concern on currently supported systems. We can just use socklen_t in the code and put in a simple check that substitutes int for socklen_t if it's missing, to cover the few stragglers. Reviewed-by: Andres Freund <andres@anarazel.de> Discussion: https://www.postgresql.org/message-id/3538f4c4-1886-64f2-dcff-aaad8267fb82@enterprisedb.com
Diffstat (limited to 'src/backend/libpq')
-rw-r--r--src/backend/libpq/auth.c2
-rw-r--r--src/backend/libpq/pqcomm.c8
2 files changed, 5 insertions, 5 deletions
diff --git a/src/backend/libpq/auth.c b/src/backend/libpq/auth.c
index a317aef1c92..7bcf52523b4 100644
--- a/src/backend/libpq/auth.c
+++ b/src/backend/libpq/auth.c
@@ -3026,7 +3026,7 @@ PerformRadiusTransaction(const char *server, const char *secret, const char *por
struct addrinfo hint;
struct addrinfo *serveraddrs;
int port;
- ACCEPT_TYPE_ARG3 addrsize;
+ socklen_t addrsize;
fd_set fdset;
struct timeval endtime;
int i,
diff --git a/src/backend/libpq/pqcomm.c b/src/backend/libpq/pqcomm.c
index 44782f2d88d..9ebba025cc7 100644
--- a/src/backend/libpq/pqcomm.c
+++ b/src/backend/libpq/pqcomm.c
@@ -1632,7 +1632,7 @@ pq_getkeepalivesidle(Port *port)
if (port->default_keepalives_idle == 0)
{
#ifndef WIN32
- ACCEPT_TYPE_ARG3 size = sizeof(port->default_keepalives_idle);
+ socklen_t size = sizeof(port->default_keepalives_idle);
if (getsockopt(port->sock, IPPROTO_TCP, PG_TCP_KEEPALIVE_IDLE,
(char *) &port->default_keepalives_idle,
@@ -1717,7 +1717,7 @@ pq_getkeepalivesinterval(Port *port)
if (port->default_keepalives_interval == 0)
{
#ifndef WIN32
- ACCEPT_TYPE_ARG3 size = sizeof(port->default_keepalives_interval);
+ socklen_t size = sizeof(port->default_keepalives_interval);
if (getsockopt(port->sock, IPPROTO_TCP, TCP_KEEPINTVL,
(char *) &port->default_keepalives_interval,
@@ -1800,7 +1800,7 @@ pq_getkeepalivescount(Port *port)
if (port->default_keepalives_count == 0)
{
- ACCEPT_TYPE_ARG3 size = sizeof(port->default_keepalives_count);
+ socklen_t size = sizeof(port->default_keepalives_count);
if (getsockopt(port->sock, IPPROTO_TCP, TCP_KEEPCNT,
(char *) &port->default_keepalives_count,
@@ -1875,7 +1875,7 @@ pq_gettcpusertimeout(Port *port)
if (port->default_tcp_user_timeout == 0)
{
- ACCEPT_TYPE_ARG3 size = sizeof(port->default_tcp_user_timeout);
+ socklen_t size = sizeof(port->default_tcp_user_timeout);
if (getsockopt(port->sock, IPPROTO_TCP, TCP_USER_TIMEOUT,
(char *) &port->default_tcp_user_timeout,