get rid of HAVE_SIGPROCMASK
authorTomas Vondra <[email protected]>
Mon, 7 Nov 2016 19:58:04 +0000 (20:58 +0100)
committerTomas Vondra <[email protected]>
Mon, 7 Nov 2016 19:58:04 +0000 (20:58 +0100)
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.

src/backend/pgxc/pool/poolmgr.c
src/gtm/libpq/pqsignal.c
src/include/gtm/pqsignal.h

index 4db8f12dfa9eb9c3cf7f590e0047dbaeb8cc6f56..336101419ec9fd4a5ae1a885609482d9491574e9 100644 (file)
@@ -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)
index e3f482c2f114a36a4397547d0fabb4bf792ebce5..05af122348de1fea134f80bfb0d32061048a195b 100644 (file)
 
 #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
 }
 
 
index c6d346e913ef3a26ca442b4c4693277a025ac3d4..ce282ed5123c510cc8fbd7816037f0d3e6b14939 100644 (file)
 
 #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);