aboutsummaryrefslogtreecommitdiff
path: root/src/backend/tcop/postgres.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2001-08-04 00:14:43 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2001-08-04 00:14:43 +0000
commitdad8e410d0c4329ec68392c442e1f9dafc8ec17c (patch)
tree5e512caa61cd99f2968ff3707c9e058d5760e118 /src/backend/tcop/postgres.c
parent2b769c82126eeb87eb02a6c1a301beb4edd14407 (diff)
downloadpostgresql-dad8e410d0c4329ec68392c442e1f9dafc8ec17c.tar.gz
postgresql-dad8e410d0c4329ec68392c442e1f9dafc8ec17c.zip
Fix handling of SIGCHLD, per recent pghackers discussion: on some
platforms system(2) gets confused unless the signal handler is set to SIG_DFL, not SIG_IGN. pgstats.c now uses pqsignal() as it should, not signal(). Also, arrange for the stats collector process to show a reasonable ID in 'ps', rather than looking like a postmaster.
Diffstat (limited to 'src/backend/tcop/postgres.c')
-rw-r--r--src/backend/tcop/postgres.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c
index 4083d0cd020..ac701704c16 100644
--- a/src/backend/tcop/postgres.c
+++ b/src/backend/tcop/postgres.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.229 2001/07/31 22:55:45 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.230 2001/08/04 00:14:43 tgl Exp $
*
* NOTES
* this is the "main" module of the postgres backend and
@@ -1102,7 +1102,9 @@ usage(char *progname)
* ----------------------------------------------------------------
*/
int
-PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[], const char *username)
+PostgresMain(int argc, char *argv[],
+ int real_argc, char *real_argv[],
+ const char *username)
{
int flag;
@@ -1535,15 +1537,15 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[], const cha
*/
pqsignal(SIGPIPE, SIG_IGN);
pqsignal(SIGUSR1, SIG_IGN); /* this signal available for use */
+
pqsignal(SIGUSR2, Async_NotifyHandler); /* flush also sinval cache */
pqsignal(SIGFPE, FloatExceptionHandler);
- pqsignal(SIGCHLD, SIG_IGN); /* ignored (may get this in system()
- * calls) */
/*
* Reset some signals that are accepted by postmaster but not by
* backend
*/
+ pqsignal(SIGCHLD, SIG_DFL); /* system() requires this on some platforms */
pqsignal(SIGTTIN, SIG_DFL);
pqsignal(SIGTTOU, SIG_DFL);
pqsignal(SIGCONT, SIG_DFL);
@@ -1711,7 +1713,7 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[], const cha
if (!IsUnderPostmaster)
{
puts("\nPOSTGRES backend interactive interface ");
- puts("$Revision: 1.229 $ $Date: 2001/07/31 22:55:45 $\n");
+ puts("$Revision: 1.230 $ $Date: 2001/08/04 00:14:43 $\n");
}
/*