Remove some dead IsUnderPostmaster code in bootstrap.c. master
authorAndres Freund <[email protected]>
Tue, 13 Jan 2015 15:44:09 +0000 (16:44 +0100)
committerAndres Freund <[email protected]>
Tue, 13 Jan 2015 19:45:03 +0000 (20:45 +0100)
Since commit 626eb021988a2 has introduced the auxiliary process
infrastructure bootstrap_signals() was never used when forked from
postmaster.

Remove the IsUnderPostmaster specific code, and add a appropriate
assertion.

src/backend/bootstrap/bootstrap.c

index 4c650fb0a41f8d0e062f7fb55a2a6f5cbde5bf92..a17f3ff39ad56273917e7ace95f219b5676b73ea 100644 (file)
@@ -505,42 +505,13 @@ BootstrapModeMain(void)
 static void
 bootstrap_signals(void)
 {
-   if (IsUnderPostmaster)
-   {
-       /*
-        * Properly accept or ignore signals the postmaster might send us
-        */
-       pqsignal(SIGHUP, SIG_IGN);
-       pqsignal(SIGINT, SIG_IGN);      /* ignore query-cancel */
-       pqsignal(SIGTERM, die);
-       pqsignal(SIGQUIT, quickdie);
-       pqsignal(SIGALRM, SIG_IGN);
-       pqsignal(SIGPIPE, SIG_IGN);
-       pqsignal(SIGUSR1, SIG_IGN);
-       pqsignal(SIGUSR2, SIG_IGN);
-
-       /*
-        * Reset some signals that are accepted by postmaster but not here
-        */
-       pqsignal(SIGCHLD, SIG_DFL);
-       pqsignal(SIGTTIN, SIG_DFL);
-       pqsignal(SIGTTOU, SIG_DFL);
-       pqsignal(SIGCONT, SIG_DFL);
-       pqsignal(SIGWINCH, SIG_DFL);
+   Assert(!IsUnderPostmaster);
 
-       /*
-        * Unblock signals (they were blocked when the postmaster forked us)
-        */
-       PG_SETMASK(&UnBlockSig);
-   }
-   else
-   {
-       /* Set up appropriately for interactive use */
-       pqsignal(SIGHUP, die);
-       pqsignal(SIGINT, die);
-       pqsignal(SIGTERM, die);
-       pqsignal(SIGQUIT, die);
-   }
+   /* Set up appropriately for interactive use */
+   pqsignal(SIGHUP, die);
+   pqsignal(SIGINT, die);
+   pqsignal(SIGTERM, die);
+   pqsignal(SIGQUIT, die);
 }
 
 /*