Much to my chagrin, I recently noticed that I forgot to convert the
pgstat fork() code to use fork_process() when I applied the original
fork_process() patch a few months ago. This patch does that.
Barring any objections, I'll apply this tomorrow.
-Neil
Index: src/backend/postmaster/pgstat.c
===================================================================
RCS file: /var/lib/cvs/pgsql/src/backend/postmaster/pgstat.c,v
retrieving revision 1.89
diff -c -r1.89 pgstat.c
*** src/backend/postmaster/pgstat.c 31 Mar 2005 23:20:49 -0000 1.89
--- src/backend/postmaster/pgstat.c 7 Apr 2005 07:51:23 -0000
***************
*** 40,45 ****
--- 40,46 ----
#include "libpq/pqsignal.h"
#include "mb/pg_wchar.h"
#include "miscadmin.h"
+ #include "postmaster/fork_process.h"
#include "postmaster/postmaster.h"
#include "storage/backendid.h"
#include "storage/fd.h"
***************
*** 576,601 ****
/*
* Okay, fork off the collector.
*/
-
- fflush(stdout);
- fflush(stderr);
-
- #ifdef __BEOS__
- /* Specific beos actions before backend startup */
- beos_before_backend_startup();
- #endif
-
#ifdef EXEC_BACKEND
switch ((pgStatPid = pgstat_forkexec(STAT_PROC_BUFFER)))
#else
! switch ((pgStatPid = fork()))
#endif
{
case -1:
- #ifdef __BEOS__
- /* Specific beos actions */
- beos_backend_startup_failed();
- #endif
ereport(LOG,
(errmsg("could not fork statistics buffer: %m")));
return 0;
--- 577,589 ----
/*
* Okay, fork off the collector.
*/
#ifdef EXEC_BACKEND
switch ((pgStatPid = pgstat_forkexec(STAT_PROC_BUFFER)))
#else
! switch ((pgStatPid = fork_process()))
#endif
{
case -1:
ereport(LOG,
(errmsg("could not fork statistics buffer: %m")));
return 0;
***************
*** 603,612 ****
#ifndef EXEC_BACKEND
case 0:
/* in postmaster child ... */
- #ifdef __BEOS__
- /* Specific beos actions after backend startup */
- beos_backend_startup();
- #endif
/* Close the postmaster's sockets */
ClosePostmasterPorts(false);
--- 591,596 ----