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

Commit94f5246

Browse files
committed
Fix uninitialized-variable bug.
For some reason, neither of the compilers I usually use noticed theuninitialized-variable problem I introduced in commit7e2a18a.That's hardly a good enough excuse though. Committing with brown paper bagon head.In addition to putting the operations in the right order, move thedeclaration of "now" inside the loop; there's no need for it to beoutside, and that does wake up older gcc enough to notice any similarfuture problem.Back-patch to 9.4; earlier versions lack the time-to-SIGKILL stanzaso there's no bug.
1 parent41562b1 commit94f5246

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

‎src/backend/postmaster/postmaster.c

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1601,8 +1601,7 @@ ServerLoop(void)
16011601
{
16021602
fd_setreadmask;
16031603
intnSockets;
1604-
time_tnow,
1605-
last_lockfile_recheck_time,
1604+
time_tlast_lockfile_recheck_time,
16061605
last_touch_time;
16071606

16081607
last_lockfile_recheck_time=last_touch_time=time(NULL);
@@ -1613,6 +1612,7 @@ ServerLoop(void)
16131612
{
16141613
fd_setrmask;
16151614
intselres;
1615+
time_tnow;
16161616

16171617
/*
16181618
* Wait for a connection request to arrive.
@@ -1764,6 +1764,16 @@ ServerLoop(void)
17641764
Assert(pthread_is_threaded_np()==0);
17651765
#endif
17661766

1767+
/*
1768+
* Lastly, check to see if it's time to do some things that we don't
1769+
* want to do every single time through the loop, because they're a
1770+
* bit expensive. Note that there's up to a minute of slop in when
1771+
* these tasks will be performed, since DetermineSleepTime() will let
1772+
* us sleep at most that long; except for SIGKILL timeout which has
1773+
* special-case logic there.
1774+
*/
1775+
now=time(NULL);
1776+
17671777
/*
17681778
* If we already sent SIGQUIT to children and they are slow to shut
17691779
* down, it's time to send them SIGKILL. This doesn't happen
@@ -1782,15 +1792,6 @@ ServerLoop(void)
17821792
AbortStartTime=0;
17831793
}
17841794

1785-
/*
1786-
* Lastly, check to see if it's time to do some things that we don't
1787-
* want to do every single time through the loop, because they're a
1788-
* bit expensive. Note that there's up to a minute of slop in when
1789-
* these tasks will be performed, since DetermineSleepTime() will let
1790-
* us sleep at most that long.
1791-
*/
1792-
now=time(NULL);
1793-
17941795
/*
17951796
* Once a minute, verify that postmaster.pid hasn't been removed or
17961797
* overwritten. If it has, we force a shutdown. This avoids having

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp