Skip to content

Commit 496439d

Browse files
committed
Fix compiler warning in WaitForBackgroundWorkerStartup().
Per complaint from Andrew Gierth.
1 parent 6e5f6e5 commit 496439d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/backend/postmaster/bgworker.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -863,7 +863,6 @@ BgwHandleStatus
863863
WaitForBackgroundWorkerStartup(BackgroundWorkerHandle *handle, pid_t *pidp)
864864
{
865865
BgwHandleStatus status;
866-
pid_t pid;
867866
int rc;
868867
bool save_set_latch_on_sigusr1;
869868

@@ -874,9 +873,13 @@ WaitForBackgroundWorkerStartup(BackgroundWorkerHandle *handle, pid_t *pidp)
874873
{
875874
for (;;)
876875
{
876+
pid_t pid;
877+
877878
CHECK_FOR_INTERRUPTS();
878879

879880
status = GetBackgroundWorkerPid(handle, &pid);
881+
if (status == BGWH_STARTED)
882+
*pidp = pid;
880883
if (status != BGWH_NOT_YET_STARTED)
881884
break;
882885

@@ -900,6 +903,5 @@ WaitForBackgroundWorkerStartup(BackgroundWorkerHandle *handle, pid_t *pidp)
900903
PG_END_TRY();
901904

902905
set_latch_on_sigusr1 = save_set_latch_on_sigusr1;
903-
*pidp = pid;
904906
return status;
905907
}

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