Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf0ee42d

Browse files
committed
Fix unportable coding in DetermineSleepTime().
We should not assume that struct timeval.tv_sec is a long, becauseit ain't necessarily. (POSIX says that it's a time_t, which mightwell be 64 bits now or in the future; or for that matter might be32 bits on machines with 64-bit longs.) Per buildfarm member panther.Back-patch to 9.3 where the dubious coding was introduced.
1 parent60ff2fd commitf0ee42d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

‎src/backend/postmaster/postmaster.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1462,10 +1462,12 @@ DetermineSleepTime(struct timeval * timeout)
14621462

14631463
if (next_wakeup!=0)
14641464
{
1465+
longsecs;
14651466
intmicrosecs;
14661467

14671468
TimestampDifference(GetCurrentTimestamp(),next_wakeup,
1468-
&timeout->tv_sec,&microsecs);
1469+
&secs,&microsecs);
1470+
timeout->tv_sec=secs;
14691471
timeout->tv_usec=microsecs;
14701472

14711473
/* Ensure we don't exceed one minute */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp