Commit 93751570 authored by Noah Misch's avatar Noah Misch

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.
parent bb8582ab
......@@ -870,7 +870,10 @@ wait_pid(PG_FUNCTION_ARGS)
elog(ERROR, "must be superuser to check PID liveness");
while (kill(pid, 0) == 0)
{
CHECK_FOR_INTERRUPTS();
pg_usleep(50000);
}
if (errno != ESRCH)
elog(ERROR, "could not check PID %d liveness: %m", pid);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment