diff options
author | Andres Freund <andres@anarazel.de> | 2015-01-13 13:12:37 +0100 |
---|---|---|
committer | Andres Freund <andres@anarazel.de> | 2015-01-14 00:33:14 +0100 |
commit | 31c453165b5a656044ce1dbce89f5828c1c7e23c (patch) | |
tree | ccf0a682b390361d581a7116d6244d7feb80cd45 /src/backend/postmaster/bgworker.c | |
parent | 2be82dcf17a18511df5153bcafe67a9c1387be1e (diff) |
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.
Diffstat (limited to 'src/backend/postmaster/bgworker.c')
-rw-r--r-- | src/backend/postmaster/bgworker.c | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/src/backend/postmaster/bgworker.c b/src/backend/postmaster/bgworker.c index 8a7637baec9..6673f5ba622 100644 --- a/src/backend/postmaster/bgworker.c +++ b/src/backend/postmaster/bgworker.c @@ -13,7 +13,6 @@ #include "postgres.h" #include <unistd.h> -#include <time.h> #include "miscadmin.h" #include "libpq/pqsignal.h" @@ -556,16 +555,8 @@ StartBackgroundWorker(void) if (worker == NULL) elog(FATAL, "unable to find bgworker entry"); - /* we are a postmaster subprocess now */ - IsUnderPostmaster = true; IsBackgroundWorker = true; - /* reset MyProcPid */ - MyProcPid = getpid(); - - /* record Start Time for logging */ - MyStartTime = time(NULL); - /* Identify myself via ps */ snprintf(buf, MAXPGPATH, "bgworker: %s", worker->bgw_name); init_ps_display(buf, "", "", ""); @@ -591,15 +582,6 @@ StartBackgroundWorker(void) pg_usleep(PostAuthDelay * 1000000L); /* - * 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 - - /* * Set up signal handlers. */ if (worker->bgw_flags & BGWORKER_BACKEND_DATABASE_CONNECTION) |