diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2001-08-04 00:14:43 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2001-08-04 00:14:43 +0000 |
commit | dad8e410d0c4329ec68392c442e1f9dafc8ec17c (patch) | |
tree | 5e512caa61cd99f2968ff3707c9e058d5760e118 /src/backend/commands/dbcommands.c | |
parent | 2b769c82126eeb87eb02a6c1a301beb4edd14407 (diff) | |
download | postgresql-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/commands/dbcommands.c')
-rw-r--r-- | src/backend/commands/dbcommands.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/backend/commands/dbcommands.c b/src/backend/commands/dbcommands.c index dca75bd71d9..16b1241a027 100644 --- a/src/backend/commands/dbcommands.c +++ b/src/backend/commands/dbcommands.c @@ -9,7 +9,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/commands/dbcommands.c,v 1.76 2001/07/02 20:50:46 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/dbcommands.c,v 1.77 2001/08/04 00:14:43 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -58,7 +58,6 @@ createdb(const char *dbname, const char *dbpath, char *target_dir; char src_loc[MAXPGPATH]; char buf[2 * MAXPGPATH + 100]; - int ret; bool use_super, use_createdb; Oid src_dboid; @@ -195,9 +194,7 @@ createdb(const char *dbname, const char *dbpath, /* Copy the template database to the new location */ snprintf(buf, sizeof(buf), "cp -r '%s' '%s'", src_loc, target_dir); - ret = system(buf); - /* Some versions of SunOS seem to return ECHILD after a system() call */ - if (ret != 0 && errno != ECHILD) + if (system(buf) != 0) { if (remove_dbdirs(nominal_loc, alt_loc)) elog(ERROR, "CREATE DATABASE: could not initialize database directory"); @@ -557,7 +554,7 @@ remove_dbdirs(const char *nominal_loc, const char *alt_loc) snprintf(buf, sizeof(buf), "rm -rf '%s'", target_dir); - if (system(buf) != 0 && errno != ECHILD) + if (system(buf) != 0) { elog(NOTICE, "database directory '%s' could not be removed", target_dir); |