Skip to content

Commit 2a4bbed

Browse files
committed
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.
1 parent 06623df commit 2a4bbed

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/bin/pg_basebackup/receivelog.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -420,15 +420,20 @@ ReceiveXlogStream(PGconn *conn, XLogRecPtr startpos, uint32 timeline,
420420
if (standby_message_timeout)
421421
{
422422
TimestampTz targettime;
423+
long secs;
424+
int usecs;
423425

424426
targettime = TimestampTzPlusMilliseconds(last_status,
425427
standby_message_timeout - 1);
426428
localTimestampDifference(now,
427429
targettime,
428-
&timeout.tv_sec,
429-
(int *) &timeout.tv_usec);
430-
if (timeout.tv_sec <= 0)
430+
&secs,
431+
&usecs);
432+
if (secs <= 0)
431433
timeout.tv_sec = 1; /* Always sleep at least 1 sec */
434+
else
435+
timeout.tv_sec = secs;
436+
timeout.tv_sec = usecs;
432437
timeoutptr = &timeout;
433438
}
434439
else

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy