Skip to content

Commit 9375157

Browse files
committed
Add CHECK_FOR_INTERRUPTS() to the wait_pid() loop.
Though the one contemporary caller uses it in a limited way, this function could loop indefinitely if pointed to an arbitrary PID.
1 parent bb8582a commit 9375157

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/test/regress/regress.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -870,7 +870,10 @@ wait_pid(PG_FUNCTION_ARGS)
870870
elog(ERROR, "must be superuser to check PID liveness");
871871

872872
while (kill(pid, 0) == 0)
873+
{
874+
CHECK_FOR_INTERRUPTS();
873875
pg_usleep(50000);
876+
}
874877

875878
if (errno != ESRCH)
876879
elog(ERROR, "could not check PID %d liveness: %m", pid);

0 commit comments

Comments
 (0)