Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 879e50f

Browse files
committed
Fixes for PQconnectdb_safe
1 parent a539d00 commit 879e50f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

multimaster.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4193,6 +4193,7 @@ PQconnectdb_safe(const char *conninfo, int timeout)
41934193
{
41944194
MTM_ELOG(WARNING, "Could not connect to '%s': %s",
41954195
safe_connstr, PQerrorMessage(conn));
4196+
return conn;
41964197
}
41974198

41984199
if (timeout != 0)
@@ -4202,13 +4203,15 @@ PQconnectdb_safe(const char *conninfo, int timeout)
42024203
if (socket_fd < 0)
42034204
{
42044205
MTM_ELOG(WARNING, "Referee socket is invalid");
4206+
return conn;
42054207
}
42064208

4207-
if (setsockopt(socket_fd, SOL_SOCKET, SO_RCVTIMEO,
4208-
(char *)&tv, sizeof(tv)) < 0)
4209+
if (pg_setsockopt(socket_fd, SOL_SOCKET, SO_RCVTIMEO,
4210+
(char *)&tv, sizeof(tv), MtmUseRDMA) < 0)
42094211
{
42104212
MTM_ELOG(WARNING, "Could not set referee socket timeout: %s",
42114213
strerror(errno));
4214+
return conn;
42124215
}
42134216
}
42144217

0 commit comments

Comments
 (0)