mirror of
https://github.com/postgres/postgres.git
synced 2025-11-10 17:42:29 +03:00
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
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user