1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-26 01:22:12 +03:00

Commonalize process startup code.

Move common code, that was duplicated in every postmaster child/every
standalone process, into two functions in miscinit.c.  Not only does
that already result in a fair amount of net code reduction but it also
makes it much easier to remove more duplication in the future. The
prime motivation wasn't code deduplication though, but easier addition
of new common code.
This commit is contained in:
Andres Freund
2015-01-13 13:12:37 +01:00
parent 2be82dcf17
commit 31c453165b
15 changed files with 96 additions and 274 deletions

View File

@ -177,15 +177,6 @@ HandleStartupProcInterrupts(void)
void
StartupProcessMain(void)
{
/*
* If possible, make this process a group leader, so that the postmaster
* can signal any child processes too.
*/
#ifdef HAVE_SETSID
if (setsid() < 0)
elog(FATAL, "setsid() failed: %m");
#endif
/*
* Properly accept or ignore signals the postmaster might send us.
*/