mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
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.
This commit is contained in:
@ -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);
|
||||
|
Reference in New Issue
Block a user