7
7
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
8
8
* Portions Copyright (c) 1994, Regents of the University of California
9
9
*
10
- * $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.331 2009/02/18 15:58:40 heikki Exp $
10
+ * $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.332 2009/02/23 09:28:49 heikki Exp $
11
11
*
12
12
*-------------------------------------------------------------------------
13
13
*/
@@ -432,7 +432,7 @@ static bool InRedo = false;
432
432
static volatile sig_atomic_t shutdown_requested = false;
433
433
/*
434
434
* Flag set when executing a restore command, to tell SIGTERM signal handler
435
- * that it's safe to just proc_exit(0) .
435
+ * that it's safe to just proc_exit.
436
436
*/
437
437
static volatile sig_atomic_t in_restore_command = false;
438
438
@@ -2752,7 +2752,7 @@ RestoreArchivedFile(char *path, const char *xlogfname,
2752
2752
*/
2753
2753
in_restore_command = true;
2754
2754
if (shutdown_requested )
2755
- proc_exit (0 );
2755
+ proc_exit (1 );
2756
2756
2757
2757
/*
2758
2758
* Copy xlog from archival storage to XLOGDIR
@@ -2818,7 +2818,7 @@ RestoreArchivedFile(char *path, const char *xlogfname,
2818
2818
* On SIGTERM, assume we have received a fast shutdown request, and exit
2819
2819
* cleanly. It's pure chance whether we receive the SIGTERM first, or the
2820
2820
* child process. If we receive it first, the signal handler will call
2821
- * proc_exit(0) , otherwise we do it here. If we or the child process
2821
+ * proc_exit, otherwise we do it here. If we or the child process
2822
2822
* received SIGTERM for any other reason than a fast shutdown request,
2823
2823
* postmaster will perform an immediate shutdown when it sees us exiting
2824
2824
* unexpectedly.
@@ -2829,7 +2829,7 @@ RestoreArchivedFile(char *path, const char *xlogfname,
2829
2829
* too.
2830
2830
*/
2831
2831
if (WTERMSIG (rc ) == SIGTERM )
2832
- proc_exit (0 );
2832
+ proc_exit (1 );
2833
2833
2834
2834
signaled = WIFSIGNALED (rc ) || WEXITSTATUS (rc ) > 125 ;
2835
2835
@@ -5367,7 +5367,7 @@ StartupXLOG(void)
5367
5367
* recovery.
5368
5368
*/
5369
5369
if (shutdown_requested )
5370
- proc_exit (0 );
5370
+ proc_exit (1 );
5371
5371
5372
5372
/*
5373
5373
* Have we reached our safe starting point? If so, we can
@@ -7646,7 +7646,7 @@ static void
7646
7646
StartupProcShutdownHandler (SIGNAL_ARGS )
7647
7647
{
7648
7648
if (in_restore_command )
7649
- proc_exit (0 );
7649
+ proc_exit (1 );
7650
7650
else
7651
7651
shutdown_requested = true;
7652
7652
}
@@ -7694,9 +7694,9 @@ StartupProcessMain(void)
7694
7694
7695
7695
BuildFlatFiles (false);
7696
7696
7697
- /* Let postmaster know that startup is finished */
7698
- SendPostmasterSignal ( PMSIGNAL_RECOVERY_COMPLETED );
7699
-
7700
- /* exit normally */
7697
+ /*
7698
+ * Exit normally. Exit code 0 tells postmaster that we completed
7699
+ * recovery successfully.
7700
+ */
7701
7701
proc_exit (0 );
7702
7702
}
0 commit comments