diff options
author | Tomas Vondra | 2016-11-07 19:58:04 +0000 |
---|---|---|
committer | Tomas Vondra | 2016-11-07 19:58:04 +0000 |
commit | ada0ae82c2a62ec5ab29dabb1968a35cdfde795b (patch) | |
tree | 81505012eed176ea32bef637b3387eec0a5f416c | |
parent | f8e63460b37164981321a3a0f997ecd513913936 (diff) |
get rid of HAVE_SIGPROCMASK
The compilation was failing in poolmgr.c because of incorrect types
when tweaking signals. After inspection it seems HAVE_SIGPROCMASK
is not actually needed (it's not defined anywhere, and upstream is
not using it either) so just get rid of it entirely.
-rw-r--r-- | src/backend/pgxc/pool/poolmgr.c | 4 | ||||
-rw-r--r-- | src/gtm/libpq/pqsignal.c | 25 | ||||
-rw-r--r-- | src/include/gtm/pqsignal.h | 20 |
3 files changed, 7 insertions, 42 deletions
diff --git a/src/backend/pgxc/pool/poolmgr.c b/src/backend/pgxc/pool/poolmgr.c index 4db8f12dfa..336101419e 100644 --- a/src/backend/pgxc/pool/poolmgr.c +++ b/src/backend/pgxc/pool/poolmgr.c @@ -217,11 +217,7 @@ PoolManagerInit() /* TODO other signal handlers */ /* We allow SIGQUIT (quickdie) at all times */ -#ifdef HAVE_SIGPROCMASK sigdelset(&BlockSig, SIGQUIT); -#else - BlockSig &= ~(sigmask(SIGQUIT)); -#endif /* * Unblock signals (they were blocked when the postmaster forked us) diff --git a/src/gtm/libpq/pqsignal.c b/src/gtm/libpq/pqsignal.c index e3f482c2f1..05af122348 100644 --- a/src/gtm/libpq/pqsignal.c +++ b/src/gtm/libpq/pqsignal.c @@ -46,17 +46,9 @@ #include "gtm/pqsignal.h" - -#ifdef HAVE_SIGPROCMASK sigset_t UnBlockSig, BlockSig, AuthBlockSig; -#else -int UnBlockSig, - BlockSig, - AuthBlockSig; -#endif - /* * Initialize BlockSig, UnBlockSig, and AuthBlockSig. @@ -74,8 +66,6 @@ int UnBlockSig, void pqinitmask(void) { -#ifdef HAVE_SIGPROCMASK - sigemptyset(&UnBlockSig); /* First set all signals, then clear some. */ @@ -130,21 +120,6 @@ pqinitmask(void) #ifdef SIGALRM sigdelset(&AuthBlockSig, SIGALRM); #endif -#else - /* Set the signals we want. */ - UnBlockSig = 0; - BlockSig = sigmask(SIGQUIT) | - sigmask(SIGTERM) | sigmask(SIGALRM) | - /* common signals between two */ - sigmask(SIGHUP) | - sigmask(SIGINT) | sigmask(SIGUSR1) | - sigmask(SIGUSR2) | sigmask(SIGCHLD) | - sigmask(SIGWINCH) | sigmask(SIGFPE); - AuthBlockSig = sigmask(SIGHUP) | - sigmask(SIGINT) | sigmask(SIGUSR1) | - sigmask(SIGUSR2) | sigmask(SIGCHLD) | - sigmask(SIGWINCH) | sigmask(SIGFPE); -#endif } diff --git a/src/include/gtm/pqsignal.h b/src/include/gtm/pqsignal.h index c6d346e913..ce282ed512 100644 --- a/src/include/gtm/pqsignal.h +++ b/src/include/gtm/pqsignal.h @@ -21,24 +21,18 @@ #include <signal.h> -#ifdef HAVE_SIGPROCMASK -extern sigset_t UnBlockSig, - BlockSig, - AuthBlockSig; - -#define PG_SETMASK(mask) sigprocmask(SIG_SETMASK, mask, NULL) -#else -extern int UnBlockSig, - BlockSig, - AuthBlockSig; - #ifndef WIN32 -#define PG_SETMASK(mask) sigsetmask(*((int*)(mask))) +#define PG_SETMASK(mask) sigprocmask(SIG_SETMASK, mask, NULL) #else +/* Emulate POSIX sigset_t APIs on Windows */ +typedef int sigset_t; #define PG_SETMASK(mask) pqsigsetmask(*((int*)(mask))) int pqsigsetmask(int mask); #endif -#endif + +extern sigset_t UnBlockSig, + BlockSig, + AuthBlockSig; extern void pqinitmask(void); |