Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf53cd94

Browse files
author
Neil Conway
committed
Use fork_process() to avoid some fork()-related boilerplate code when
forking the stats collector child process.
1 parent26f831a commitf53cd94

File tree

1 file changed

+3
-19
lines changed

1 file changed

+3
-19
lines changed

‎src/backend/postmaster/pgstat.c

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*
1414
*Copyright (c) 2001-2005, PostgreSQL Global Development Group
1515
*
16-
*$PostgreSQL: pgsql/src/backend/postmaster/pgstat.c,v 1.89 2005/03/31 23:20:49 tgl Exp $
16+
*$PostgreSQL: pgsql/src/backend/postmaster/pgstat.c,v 1.90 2005/04/08 00:55:07 neilc Exp $
1717
* ----------
1818
*/
1919
#include"postgres.h"
@@ -40,6 +40,7 @@
4040
#include"libpq/pqsignal.h"
4141
#include"mb/pg_wchar.h"
4242
#include"miscadmin.h"
43+
#include"postmaster/fork_process.h"
4344
#include"postmaster/postmaster.h"
4445
#include"storage/backendid.h"
4546
#include"storage/fd.h"
@@ -576,37 +577,20 @@ pgstat_start(void)
576577
/*
577578
* Okay, fork off the collector.
578579
*/
579-
580-
fflush(stdout);
581-
fflush(stderr);
582-
583-
#ifdef__BEOS__
584-
/* Specific beos actions before backend startup */
585-
beos_before_backend_startup();
586-
#endif
587-
588580
#ifdefEXEC_BACKEND
589581
switch ((pgStatPid=pgstat_forkexec(STAT_PROC_BUFFER)))
590582
#else
591-
switch ((pgStatPid=fork()))
583+
switch ((pgStatPid=fork_process()))
592584
#endif
593585
{
594586
case-1:
595-
#ifdef__BEOS__
596-
/* Specific beos actions */
597-
beos_backend_startup_failed();
598-
#endif
599587
ereport(LOG,
600588
(errmsg("could not fork statistics buffer: %m")));
601589
return0;
602590

603591
#ifndefEXEC_BACKEND
604592
case0:
605593
/* in postmaster child ... */
606-
#ifdef__BEOS__
607-
/* Specific beos actions after backend startup */
608-
beos_backend_startup();
609-
#endif
610594
/* Close the postmaster's sockets */
611595
ClosePostmasterPorts(false);
612596

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp