Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit a9fa525

Browse files
committed
Clean up broken usage of HAVE_DECL_SYS_SIGLIST and inconsistent/poorly
formatted error messages.
1 parent 91ed399 commit a9fa525

File tree

2 files changed

+15
-13
lines changed

2 files changed

+15
-13
lines changed

src/backend/postmaster/postmaster.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
*
3838
*
3939
* IDENTIFICATION
40-
* $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.514 2007/01/28 03:50:34 momjian Exp $
40+
* $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.515 2007/01/28 06:32:03 tgl Exp $
4141
*
4242
* NOTES
4343
*
@@ -2427,18 +2427,19 @@ LogChildExit(int lev, const char *procname, int pid, int exitstatus)
24272427
/*------
24282428
translator: %s is a noun phrase describing a child process, such as
24292429
"server process" */
2430-
(errmsg("%s (PID %d) was terminated by exception %X",
2430+
(errmsg("%s (PID %d) was terminated by exception 0x%X",
24312431
procname, pid, WTERMSIG(exitstatus)),
24322432
errhint("See C include file \"ntstatus.h\" for a description of the hex value.")));
2433-
#elif defined(HAVE_DECL_SYS_SIGLIST)
2433+
#elif defined(HAVE_DECL_SYS_SIGLIST) && HAVE_DECL_SYS_SIGLIST
24342434
ereport(lev,
24352435

24362436
/*------
24372437
translator: %s is a noun phrase describing a child process, such as
24382438
"server process" */
2439-
(errmsg("%s (PID %d) was terminated by signal: %s (%d)",
2440-
procname, pid, WTERMSIG(exitstatus) < NSIG ?
2441-
sys_siglist[WTERMSIG(exitstatus)] : "unknown signal",
2439+
(errmsg("%s (PID %d) was terminated by signal %s (%d)",
2440+
procname, pid,
2441+
WTERMSIG(exitstatus) < NSIG ?
2442+
sys_siglist[WTERMSIG(exitstatus)] : "(unknown)",
24422443
WTERMSIG(exitstatus))));
24432444
#else
24442445
ereport(lev,
@@ -2455,7 +2456,7 @@ LogChildExit(int lev, const char *procname, int pid, int exitstatus)
24552456
/*------
24562457
translator: %s is a noun phrase describing a child process, such as
24572458
"server process" */
2458-
(errmsg("%s (PID %d) exited with unexpected status %d",
2459+
(errmsg("%s (PID %d) exited with unrecognized status %d",
24592460
procname, pid, exitstatus)));
24602461
}
24612462

src/port/exec.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*
1010
*
1111
* IDENTIFICATION
12-
* $PostgreSQL: pgsql/src/port/exec.c,v 1.51 2007/01/28 03:50:34 momjian Exp $
12+
* $PostgreSQL: pgsql/src/port/exec.c,v 1.52 2007/01/28 06:32:02 tgl Exp $
1313
*
1414
*-------------------------------------------------------------------------
1515
*/
@@ -584,12 +584,13 @@ pclose_check(FILE *stream)
584584
WEXITSTATUS(exitstatus));
585585
else if (WIFSIGNALED(exitstatus))
586586
#if defined(WIN32)
587-
log_error(_("child process was terminated by exception %X\nSee C include file \"ntstatus.h\" for a description of the hex value."),
587+
log_error(_("child process was terminated by exception 0x%X"),
588+
WTERMSIG(exitstatus));
589+
#elif defined(HAVE_DECL_SYS_SIGLIST) && HAVE_DECL_SYS_SIGLIST
590+
log_error(_("child process was terminated by signal %s (%d)"),
591+
WTERMSIG(exitstatus) < NSIG ?
592+
sys_siglist[WTERMSIG(exitstatus)] : "(unknown)",
588593
WTERMSIG(exitstatus));
589-
#elif defined(HAVE_DECL_SYS_SIGLIST)
590-
log_error(_("child process was terminated by signal: %s"),
591-
WTERMSIG(exitstatus) < NSIG ?
592-
sys_siglist[WTERMSIG(exitstatus)] : "unknown signal");
593594
#else
594595
log_error(_("child process was terminated by signal %d"),
595596
WTERMSIG(exitstatus));

0 commit comments

Comments
 (0)