diff options
| author | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2012-10-02 17:37:41 +0300 |
|---|---|---|
| committer | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2012-10-02 17:46:53 +0300 |
| commit | 4e6a910069d6c6f31e72c0891ee8495df61759bb (patch) | |
| tree | 76126784fa023e938c52f495cd9f9fba6f478964 /src | |
| parent | a50be771c80446d36771ff6c425a152e0d332315 (diff) | |
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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/bin/pg_basebackup/receivelog.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/bin/pg_basebackup/receivelog.c b/src/bin/pg_basebackup/receivelog.c index 0aec5d2f9d2..805e9b87b32 100644 --- a/src/bin/pg_basebackup/receivelog.c +++ b/src/bin/pg_basebackup/receivelog.c @@ -420,15 +420,20 @@ ReceiveXlogStream(PGconn *conn, XLogRecPtr startpos, uint32 timeline, if (standby_message_timeout) { TimestampTz targettime; + long secs; + int usecs; targettime = TimestampTzPlusMilliseconds(last_status, standby_message_timeout - 1); localTimestampDifference(now, targettime, - &timeout.tv_sec, - (int *) &timeout.tv_usec); - if (timeout.tv_sec <= 0) + &secs, + &usecs); + if (secs <= 0) timeout.tv_sec = 1; /* Always sleep at least 1 sec */ + else + timeout.tv_sec = secs; + timeout.tv_sec = usecs; timeoutptr = &timeout; } else |
