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

Commit15e9457

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 parent56f9d91 commit15e9457

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
@@ -1596,8 +1596,7 @@ ServerLoop(void)
15961596
{
15971597
fd_setreadmask;
15981598
intnSockets;
1599-
time_tnow,
1600-
last_lockfile_recheck_time,
1599+
time_tlast_lockfile_recheck_time,
16011600
last_touch_time;
16021601

16031602
last_lockfile_recheck_time=last_touch_time=time(NULL);
@@ -1608,6 +1607,7 @@ ServerLoop(void)
16081607
{
16091608
fd_setrmask;
16101609
intselres;
1610+
time_tnow;
16111611

16121612
/*
16131613
* Wait for a connection request to arrive.
@@ -1759,6 +1759,16 @@ ServerLoop(void)
17591759
Assert(pthread_is_threaded_np()==0);
17601760
#endif
17611761

1762+
/*
1763+
* Lastly, check to see if it's time to do some things that we don't
1764+
* want to do every single time through the loop, because they're a
1765+
* bit expensive. Note that there's up to a minute of slop in when
1766+
* these tasks will be performed, since DetermineSleepTime() will let
1767+
* us sleep at most that long; except for SIGKILL timeout which has
1768+
* special-case logic there.
1769+
*/
1770+
now=time(NULL);
1771+
17621772
/*
17631773
* If we already sent SIGQUIT to children and they are slow to shut
17641774
* down, it's time to send them SIGKILL. This doesn't happen
@@ -1777,15 +1787,6 @@ ServerLoop(void)
17771787
AbortStartTime=0;
17781788
}
17791789

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

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp