diff options
Diffstat (limited to 'src/backend/bootstrap/bootstrap.c')
-rw-r--r-- | src/backend/bootstrap/bootstrap.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/backend/bootstrap/bootstrap.c b/src/backend/bootstrap/bootstrap.c index e3ae92d540d..b7428829f37 100644 --- a/src/backend/bootstrap/bootstrap.c +++ b/src/backend/bootstrap/bootstrap.c @@ -63,6 +63,8 @@ static void cleanup(void); * ---------------- */ +AuxProcType MyAuxProcType = NotAnAuxProcess; /* declared in miscadmin.h */ + Relation boot_reldesc; /* current relation descriptor */ Form_pg_attribute attrtypes[MAXATTR]; /* points to attribute info */ @@ -187,7 +189,6 @@ AuxiliaryProcessMain(int argc, char *argv[]) { char *progname = argv[0]; int flag; - AuxProcType auxType = CheckerProcess; char *userDoption = NULL; /* @@ -228,6 +229,9 @@ AuxiliaryProcessMain(int argc, char *argv[]) argc--; } + /* If no -x argument, we are a CheckerProcess */ + MyAuxProcType = CheckerProcess; + while ((flag = getopt(argc, argv, "B:c:d:D:Fr:x:-:")) != -1) { switch (flag) @@ -258,7 +262,7 @@ AuxiliaryProcessMain(int argc, char *argv[]) strlcpy(OutputFileName, optarg, MAXPGPATH); break; case 'x': - auxType = atoi(optarg); + MyAuxProcType = atoi(optarg); break; case 'c': case '-': @@ -308,7 +312,7 @@ AuxiliaryProcessMain(int argc, char *argv[]) { const char *statmsg; - switch (auxType) + switch (MyAuxProcType) { case StartupProcess: statmsg = "startup process"; @@ -374,15 +378,15 @@ AuxiliaryProcessMain(int argc, char *argv[]) /* * Assign the ProcSignalSlot for an auxiliary process. Since it * doesn't have a BackendId, the slot is statically allocated based on - * the auxiliary process type (auxType). Backends use slots indexed - * in the range from 1 to MaxBackends (inclusive), so we use + * the auxiliary process type (MyAuxProcType). Backends use slots + * indexed in the range from 1 to MaxBackends (inclusive), so we use * MaxBackends + AuxProcType + 1 as the index of the slot for an * auxiliary process. * * This will need rethinking if we ever want more than one of a * particular auxiliary process type. */ - ProcSignalInit(MaxBackends + auxType + 1); + ProcSignalInit(MaxBackends + MyAuxProcType + 1); /* finish setting up bufmgr.c */ InitBufferPoolBackend(); @@ -396,7 +400,7 @@ AuxiliaryProcessMain(int argc, char *argv[]) */ SetProcessingMode(NormalProcessing); - switch (auxType) + switch (MyAuxProcType) { case CheckerProcess: /* don't set signals, they're useless here */ @@ -436,7 +440,7 @@ AuxiliaryProcessMain(int argc, char *argv[]) proc_exit(1); /* should never return */ default: - elog(PANIC, "unrecognized process type: %d", auxType); + elog(PANIC, "unrecognized process type: %d", (int) MyAuxProcType); proc_exit(1); } } |