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

Commit87fd2db

Browse files
committed
Clean up a little more carefully around fork of pgstat subprocess.
Partial support for BEOS (not sure whether second fork of grandchildprocess needs these extra calls or not; someone who has BEOS will needto test it).
1 parent43cadb9 commit87fd2db

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

‎src/backend/postmaster/pgstat.c

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*
1717
*Copyright (c) 2001, PostgreSQL Global Development Group
1818
*
19-
*$Header: /cvsroot/pgsql/src/backend/postmaster/pgstat.c,v 1.8 2001/10/0105:36:13 tgl Exp $
19+
*$Header: /cvsroot/pgsql/src/backend/postmaster/pgstat.c,v 1.9 2001/10/0116:48:37 tgl Exp $
2020
* ----------
2121
*/
2222
#include"postgres.h"
@@ -273,9 +273,22 @@ pgstat_start(int real_argc, char *real_argv[])
273273
/*
274274
* Then fork off the collector. Remember its PID for pgstat_ispgstat.
275275
*/
276+
277+
fflush(stdout);
278+
fflush(stderr);
279+
280+
#ifdef__BEOS__
281+
/* Specific beos actions before backend startup */
282+
beos_before_backend_startup();
283+
#endif
284+
276285
switch ((pgStatPid= (int)fork()))
277286
{
278287
case-1:
288+
#ifdef__BEOS__
289+
/* Specific beos actions */
290+
beos_backend_startup_failed();
291+
#endif
279292
perror("PGSTAT: fork(2)");
280293
pgStatRunning=0;
281294
return-1;
@@ -289,6 +302,18 @@ pgstat_start(int real_argc, char *real_argv[])
289302
}
290303

291304
/* in postmaster child ... */
305+
306+
#ifdef__BEOS__
307+
/* Specific beos actions after backend startup */
308+
beos_backend_startup();
309+
#endif
310+
311+
IsUnderPostmaster= true;/* we are a postmaster subprocess now */
312+
313+
/* Lose the postmaster's on-exit routines */
314+
on_exit_reset();
315+
316+
/* Close the postmaster's sockets, except for pgstat link */
292317
ClosePostmasterPorts(false);
293318

294319
pgstat_main(real_argc,real_argv);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp