Skip to content

Commit bb7ffeb

Browse files
committed
Fixes for PQconnectdb_safe
1 parent 4a92d73 commit bb7ffeb

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

contrib/mmts/multimaster.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4197,6 +4197,7 @@ PQconnectdb_safe(const char *conninfo, int timeout)
41974197
{
41984198
MTM_ELOG(WARNING, "Could not connect to '%s': %s",
41994199
safe_connstr, PQerrorMessage(conn));
4200+
return conn;
42004201
}
42014202

42024203
if (timeout != 0)
@@ -4206,13 +4207,15 @@ PQconnectdb_safe(const char *conninfo, int timeout)
42064207
if (socket_fd < 0)
42074208
{
42084209
MTM_ELOG(WARNING, "Referee socket is invalid");
4210+
return conn;
42094211
}
42104212

4211-
if (setsockopt(socket_fd, SOL_SOCKET, SO_RCVTIMEO,
4212-
(char *)&tv, sizeof(tv)) < 0)
4213+
if (pg_setsockopt(socket_fd, SOL_SOCKET, SO_RCVTIMEO,
4214+
(char *)&tv, sizeof(tv), MtmUseRDMA) < 0)
42134215
{
42144216
MTM_ELOG(WARNING, "Could not set referee socket timeout: %s",
42154217
strerror(errno));
4218+
return conn;
42164219
}
42174220
}
42184221

0 commit comments

Comments
 (0)