1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-15 19:21:59 +03:00

Update process termination message to display signal number and name

from exec.c and postmaster.c.
This commit is contained in:
Bruce Momjian
2007-01-29 20:17:40 +00:00
parent 48ba3f5711
commit 5b4fa95984
2 changed files with 13 additions and 9 deletions

View File

@ -37,7 +37,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.515 2007/01/28 06:32:03 tgl Exp $ * $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.516 2007/01/29 20:17:40 momjian Exp $
* *
* NOTES * NOTES
* *
@ -2436,11 +2436,10 @@ 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 signal %s (%d)", (errmsg("%s (PID %d) was terminated by signal %d: %s",
procname, pid, procname, pid, WTERMSIG(exitstatus),
WTERMSIG(exitstatus) < NSIG ? WTERMSIG(exitstatus) < NSIG ?
sys_siglist[WTERMSIG(exitstatus)] : "(unknown)", sys_siglist[WTERMSIG(exitstatus)] : "(unknown)")));
WTERMSIG(exitstatus))));
#else #else
ereport(lev, ereport(lev,

View File

@ -9,7 +9,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/port/exec.c,v 1.53 2007/01/28 07:29:32 tgl Exp $ * $PostgreSQL: pgsql/src/port/exec.c,v 1.54 2007/01/29 20:17:40 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -587,9 +587,14 @@ pclose_check(FILE *stream)
log_error(_("child process was terminated by exception 0x%X"), log_error(_("child process was terminated by exception 0x%X"),
WTERMSIG(exitstatus)); WTERMSIG(exitstatus));
#elif defined(HAVE_DECL_SYS_SIGLIST) && HAVE_DECL_SYS_SIGLIST #elif defined(HAVE_DECL_SYS_SIGLIST) && HAVE_DECL_SYS_SIGLIST
log_error(_("child process was terminated by signal %s"), {
WTERMSIG(exitstatus) < NSIG ? char str[256];
sys_siglist[WTERMSIG(exitstatus)] : "(unknown)");
snprintf(str, 256, "%d: %s", WTERMSIG(exitstatus),
WTERMSIG(exitstatus) < NSIG ?
sys_siglist[WTERMSIG(exitstatus)] : "(unknown)");
log_error(_("child process was terminated by signal %s"), str);
}
#else #else
log_error(_("child process was terminated by signal %d"), log_error(_("child process was terminated by signal %d"),
WTERMSIG(exitstatus)); WTERMSIG(exitstatus));