Commit a9fa5250 authored by Tom Lane's avatar Tom Lane

Clean up broken usage of HAVE_DECL_SYS_SIGLIST and inconsistent/poorly

formatted error messages.
parent 91ed3995
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.514 2007/01/28 03:50:34 momjian Exp $ * $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.515 2007/01/28 06:32:03 tgl Exp $
* *
* NOTES * NOTES
* *
...@@ -2427,18 +2427,19 @@ LogChildExit(int lev, const char *procname, int pid, int exitstatus) ...@@ -2427,18 +2427,19 @@ LogChildExit(int lev, const char *procname, int pid, int exitstatus)
/*------ /*------
translator: %s is a noun phrase describing a child process, such as translator: %s is a noun phrase describing a child process, such as
"server process" */ "server process" */
(errmsg("%s (PID %d) was terminated by exception %X", (errmsg("%s (PID %d) was terminated by exception 0x%X",
procname, pid, WTERMSIG(exitstatus)), procname, pid, WTERMSIG(exitstatus)),
errhint("See C include file \"ntstatus.h\" for a description of the hex value."))); errhint("See C include file \"ntstatus.h\" for a description of the hex value.")));
#elif defined(HAVE_DECL_SYS_SIGLIST) #elif defined(HAVE_DECL_SYS_SIGLIST) && HAVE_DECL_SYS_SIGLIST
ereport(lev, ereport(lev,
/*------ /*------
translator: %s is a noun phrase describing a child process, such as translator: %s is a noun phrase describing a child process, such as
"server process" */ "server process" */
(errmsg("%s (PID %d) was terminated by signal: %s (%d)", (errmsg("%s (PID %d) was terminated by signal %s (%d)",
procname, pid, WTERMSIG(exitstatus) < NSIG ? procname, pid,
sys_siglist[WTERMSIG(exitstatus)] : "unknown signal", WTERMSIG(exitstatus) < NSIG ?
sys_siglist[WTERMSIG(exitstatus)] : "(unknown)",
WTERMSIG(exitstatus)))); WTERMSIG(exitstatus))));
#else #else
ereport(lev, ereport(lev,
...@@ -2455,7 +2456,7 @@ LogChildExit(int lev, const char *procname, int pid, int exitstatus) ...@@ -2455,7 +2456,7 @@ LogChildExit(int lev, const char *procname, int pid, int exitstatus)
/*------ /*------
translator: %s is a noun phrase describing a child process, such as translator: %s is a noun phrase describing a child process, such as
"server process" */ "server process" */
(errmsg("%s (PID %d) exited with unexpected status %d", (errmsg("%s (PID %d) exited with unrecognized status %d",
procname, pid, exitstatus))); procname, pid, exitstatus)));
} }
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/port/exec.c,v 1.51 2007/01/28 03:50:34 momjian Exp $ * $PostgreSQL: pgsql/src/port/exec.c,v 1.52 2007/01/28 06:32:02 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -584,12 +584,13 @@ pclose_check(FILE *stream) ...@@ -584,12 +584,13 @@ pclose_check(FILE *stream)
WEXITSTATUS(exitstatus)); WEXITSTATUS(exitstatus));
else if (WIFSIGNALED(exitstatus)) else if (WIFSIGNALED(exitstatus))
#if defined(WIN32) #if defined(WIN32)
log_error(_("child process was terminated by exception %X\nSee C include file \"ntstatus.h\" for a description of the hex value."), log_error(_("child process was terminated by exception 0x%X"),
WTERMSIG(exitstatus));
#elif defined(HAVE_DECL_SYS_SIGLIST) && HAVE_DECL_SYS_SIGLIST
log_error(_("child process was terminated by signal %s (%d)"),
WTERMSIG(exitstatus) < NSIG ?
sys_siglist[WTERMSIG(exitstatus)] : "(unknown)",
WTERMSIG(exitstatus)); WTERMSIG(exitstatus));
#elif defined(HAVE_DECL_SYS_SIGLIST)
log_error(_("child process was terminated by signal: %s"),
WTERMSIG(exitstatus) < NSIG ?
sys_siglist[WTERMSIG(exitstatus)] : "unknown signal");
#else #else
log_error(_("child process was terminated by signal %d"), log_error(_("child process was terminated by signal %d"),
WTERMSIG(exitstatus)); WTERMSIG(exitstatus));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment