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

Commit2cfc8fc

Browse files
committed
FATAL errors should cause exit with nonzero status if we are not running
under the postmaster --- specifically, if we are a standalone backendrunning under the initdb script, this is critical!
1 parente666422 commit2cfc8fc

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

‎src/backend/utils/error/elog.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/utils/error/elog.c,v 1.81 2001/02/21 06:05:23 ishii Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/utils/error/elog.c,v 1.82 2001/03/10 04:21:51 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -451,7 +451,10 @@ elog(int lev, const char *fmt, ...)
451451
* after proc_exit has begun to run. (It's proc_exit's
452452
* responsibility to see that this doesn't turn into infinite
453453
* recursion!)But in the latter case, we exit with nonzero exit
454-
* code to indicate that something's pretty wrong.
454+
* code to indicate that something's pretty wrong. We also want
455+
* to exit with nonzero exit code if not running under the postmaster
456+
* (for example, if we are being run from the initdb script, we'd
457+
* better return an error status).
455458
*/
456459
if (lev==FATAL|| !Warn_restart_ready||proc_exit_inprogress)
457460
{
@@ -463,7 +466,7 @@ elog(int lev, const char *fmt, ...)
463466
*/
464467
fflush(stdout);
465468
fflush(stderr);
466-
proc_exit((int)proc_exit_inprogress);
469+
proc_exit((int)(proc_exit_inprogress|| !IsUnderPostmaster));
467470
}
468471

469472
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp