]> granicus.if.org Git - postgresql/commitdiff
Add CHECK_FOR_INTERRUPTS() to the wait_pid() loop.
authorNoah Misch <noah@leadboat.com>
Sat, 7 Mar 2015 05:47:38 +0000 (00:47 -0500)
committerNoah Misch <noah@leadboat.com>
Sat, 7 Mar 2015 05:47:38 +0000 (00:47 -0500)
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

index 2e37d980af8877f5539388c4f5ff18accffa6399..d68c90cd9bbaa810c056d10c98895ba23a5cc9ee 100644 (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);