1
0
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:
Noah Misch
2015-03-07 00:47:38 -05:00
parent bb8582abf3
commit 9375157073

View File

@ -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);