mirror of
https://github.com/postgres/postgres.git
synced 2025-04-27 22:56:53 +03:00
Silence compiler warning about pointer type mismatch on some platforms.
timeval.t_sec is of type time_t, which is not always compatible with long. I'm not sure if this was just harmless warning or a real bug, but this fixes it, anyway.
This commit is contained in:
parent
06623df63b
commit
2a4bbed7b8
@ -420,15 +420,20 @@ ReceiveXlogStream(PGconn *conn, XLogRecPtr startpos, uint32 timeline,
|
|||||||
if (standby_message_timeout)
|
if (standby_message_timeout)
|
||||||
{
|
{
|
||||||
TimestampTz targettime;
|
TimestampTz targettime;
|
||||||
|
long secs;
|
||||||
|
int usecs;
|
||||||
|
|
||||||
targettime = TimestampTzPlusMilliseconds(last_status,
|
targettime = TimestampTzPlusMilliseconds(last_status,
|
||||||
standby_message_timeout - 1);
|
standby_message_timeout - 1);
|
||||||
localTimestampDifference(now,
|
localTimestampDifference(now,
|
||||||
targettime,
|
targettime,
|
||||||
&timeout.tv_sec,
|
&secs,
|
||||||
(int *) &timeout.tv_usec);
|
&usecs);
|
||||||
if (timeout.tv_sec <= 0)
|
if (secs <= 0)
|
||||||
timeout.tv_sec = 1; /* Always sleep at least 1 sec */
|
timeout.tv_sec = 1; /* Always sleep at least 1 sec */
|
||||||
|
else
|
||||||
|
timeout.tv_sec = secs;
|
||||||
|
timeout.tv_sec = usecs;
|
||||||
timeoutptr = &timeout;
|
timeoutptr = &timeout;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user