From 93751570731ba08dca4e791234984c3b1a15e885 Mon Sep 17 00:00:00 2001 From: Noah Misch Date: Sat, 7 Mar 2015 00:47:38 -0500 Subject: [PATCH] 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. --- src/test/regress/regress.c | 3 +++ 1 file changed, 3 insertions(+) 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); -- 2.39.5