From cdf6518ef08ee602b94db4e5ba5887a1d7053c24 Mon Sep 17 00:00:00 2001 From: Thomas Munro Date: Fri, 3 Feb 2023 10:34:56 +1300 Subject: Retire PG_SETMASK() macro. In the 90s we needed to deal with computers that still had the pre-standard signal masking APIs. That hasn't been relevant for a very long time on Unix systems, and c94ae9d8 got rid of a remaining dependency in our Windows porting code. PG_SETMASK didn't expose save/restore functionality, so we'd already started using sigprocmask() directly in places, creating the visual distraction of having two ways to spell it. It's not part of the API that extensions are expected to be using (but if they are, the change will be trivial). It seems like a good time to drop the old macro and just call the standard POSIX function. Reviewed-by: Nathan Bossart Discussion: https://postgr.es/m/CA%2BhUKG%2BKfQgrhHP2DLTohX1WwubaCBHmTzGnAEDPZ-Gug-Xskg%40mail.gmail.com --- src/backend/tcop/postgres.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/backend/tcop/postgres.c') diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index 470b734e9e0..5d439f27100 100644 --- a/src/backend/tcop/postgres.c +++ b/src/backend/tcop/postgres.c @@ -2831,7 +2831,7 @@ void quickdie(SIGNAL_ARGS) { sigaddset(&BlockSig, SIGQUIT); /* prevent nested calls */ - PG_SETMASK(&BlockSig); + sigprocmask(SIG_SETMASK, &BlockSig, NULL); /* * Prevent interrupts while exiting; though we just blocked signals that @@ -4129,7 +4129,7 @@ PostgresMain(const char *dbname, const char *username) BaseInit(); /* We need to allow SIGINT, etc during the initial transaction */ - PG_SETMASK(&UnBlockSig); + sigprocmask(SIG_SETMASK, &UnBlockSig, NULL); /* * General initialization. -- cgit v1.2.3