From: Noah Misch Date: Sat, 7 Mar 2015 05:47:38 +0000 (-0500) Subject: Add CHECK_FOR_INTERRUPTS() to the wait_pid() loop. X-Git-Tag: REL9_5_ALPHA1~664 X-Git-Url: http://git.postgresql.org/gitweb/?a=commitdiff_plain;h=93751570731ba08dca4e791234984c3b1a15e885;p=postgresql.git 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. --- diff --git a/src/test/regress/regress.c b/src/test/regress/regress.c index 2e37d980af8..d68c90cd9bb 100644 --- a/src/test/regress/regress.c +++ b/src/test/regress/regress.c @@ -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);