3737 *
3838 *
3939 * IDENTIFICATION
40- * $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.418 2004/08/01 17:45:43 tgl Exp $
40+ * $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.419 2004/08/04 20:09:47 tgl Exp $
4141 *
4242 * NOTES
4343 *
@@ -248,8 +248,8 @@ static void pmdie(SIGNAL_ARGS);
248248static void reaper (SIGNAL_ARGS );
249249static void sigusr1_handler (SIGNAL_ARGS );
250250static void dummy_handler (SIGNAL_ARGS );
251- static void CleanupProc (int pid ,int exitstatus );
252- static void HandleChildCrash (int pid ,int exitstatus );
251+ static void CleanupBackend (int pid ,int exitstatus );
252+ static void HandleChildCrash (int pid ,int exitstatus , const char * procname );
253253static void LogChildExit (int lev ,const char * procname ,
254254int pid ,int exitstatus );
255255static int BackendRun (Port * port );
@@ -1947,7 +1947,7 @@ reaper(SIGNAL_ARGS)
19471947while ((pid = win32_waitpid (& exitstatus ))> 0 )
19481948{
19491949/*
1950- * We need to do this here, and not inCleanupProc , since this is
1950+ * We need to do this here, and not inCleanupBackend , since this is
19511951 * to be called on all children when we are done with them. Could
19521952 * move to LogChildExit, but that seems like asking for future
19531953 * trouble...
@@ -2025,9 +2025,8 @@ reaper(SIGNAL_ARGS)
20252025/*
20262026 * Any unexpected exit of the bgwriter is treated as a crash.
20272027 */
2028- LogChildExit (LOG ,gettext ("background writer process" ),
2029- pid ,exitstatus );
2030- HandleChildCrash (pid ,exitstatus );
2028+ HandleChildCrash (pid ,exitstatus ,
2029+ gettext ("background writer process" ));
20312030continue ;
20322031}
20332032
@@ -2067,7 +2066,7 @@ reaper(SIGNAL_ARGS)
20672066/*
20682067 * Else do standard backend child cleanup.
20692068 */
2070- CleanupProc (pid ,exitstatus );
2069+ CleanupBackend (pid ,exitstatus );
20712070}/* loop over pending child-death reports */
20722071
20732072if (FatalError )
@@ -2116,13 +2115,13 @@ reaper(SIGNAL_ARGS)
21162115
21172116
21182117/*
2119- *CleanupProc -- cleanup after terminated backend.
2118+ *CleanupBackend -- cleanup after terminated backend.
21202119 *
21212120 * Remove all local state associated with backend.
21222121 */
21232122static void
2124- CleanupProc (int pid ,
2125- int exitstatus )/* child's exit status. */
2123+ CleanupBackend (int pid ,
2124+ int exitstatus )/* child's exit status. */
21262125{
21272126Dlelem * curr ;
21282127
@@ -2136,7 +2135,7 @@ CleanupProc(int pid,
21362135 */
21372136if (exitstatus != 0 )
21382137{
2139- HandleChildCrash (pid ,exitstatus );
2138+ HandleChildCrash (pid ,exitstatus , gettext ( "server process" ) );
21402139return ;
21412140}
21422141
@@ -2166,8 +2165,7 @@ CleanupProc(int pid,
21662165 * process, and to signal all other remaining children to quickdie.
21672166 */
21682167static void
2169- HandleChildCrash (int pid ,
2170- int exitstatus )/* child's exit status. */
2168+ HandleChildCrash (int pid ,int exitstatus ,const char * procname )
21712169{
21722170Dlelem * curr ,
21732171* next ;
@@ -2179,11 +2177,7 @@ HandleChildCrash(int pid,
21792177 */
21802178if (!FatalError )
21812179{
2182- LogChildExit (LOG ,
2183- (pid == BgWriterPID ) ?
2184- gettext ("background writer process" ) :
2185- gettext ("server process" ),
2186- pid ,exitstatus );
2180+ LogChildExit (LOG ,procname ,pid ,exitstatus );
21872181ereport (LOG ,
21882182(errmsg ("terminating any other active server processes" )));
21892183}