aboutsummaryrefslogtreecommitdiff
path: root/src/backend
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2007-01-28 01:12:05 +0000
committerBruce Momjian <bruce@momjian.us>2007-01-28 01:12:05 +0000
commit82480fc2542fc92bdbc917060b0d578120e9997d (patch)
tree134525a3b173b03ae93ac8b95c3bf07e27d3ae7c /src/backend
parent3ec7ae1b67da4e9094eaad5781e0f39ecc395546 (diff)
downloadpostgresql-82480fc2542fc92bdbc917060b0d578120e9997d.tar.gz
postgresql-82480fc2542fc92bdbc917060b0d578120e9997d.zip
Use sys_siglist[] to print out signal names for signal exits, rather
than just numbers.
Diffstat (limited to 'src/backend')
-rw-r--r--src/backend/postmaster/postmaster.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c
index a321f3d1f37..6c4ff16ed8c 100644
--- a/src/backend/postmaster/postmaster.c
+++ b/src/backend/postmaster/postmaster.c
@@ -37,7 +37,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.512 2007/01/23 03:28:49 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.513 2007/01/28 01:12:05 momjian Exp $
*
* NOTES
*
@@ -2421,23 +2421,33 @@ LogChildExit(int lev, const char *procname, int pid, int exitstatus)
(errmsg("%s (PID %d) exited with exit code %d",
procname, pid, WEXITSTATUS(exitstatus))));
else if (WIFSIGNALED(exitstatus))
-#ifndef WIN32
+#if defined(WIN32)
ereport(lev,
/*------
translator: %s is a noun phrase describing a child process, such as
"server process" */
- (errmsg("%s (PID %d) was terminated by signal %d",
- procname, pid, WTERMSIG(exitstatus))));
+ (errmsg("%s (PID %d) was terminated by exception %X",
+ procname, pid, WTERMSIG(exitstatus)),
+ errhint("See C include file \"ntstatus.h\" for a description of the hex value.")));
+#elif defined(HAVE_SYS_SIGLIST)
+ ereport(lev,
+
+ /*------
+ translator: %s is a noun phrase describing a child process, such as
+ "server process" */
+ (errmsg("%s (PID %d) was terminated by signal: %s (%d)",
+ procname, pid, WTERMSIG(exitstatus) < NSIG ?
+ sys_siglist[WTERMSIG(exitstatus)] : "unknown signal",
+ WTERMSIG(exitstatus))));
#else
ereport(lev,
/*------
translator: %s is a noun phrase describing a child process, such as
"server process" */
- (errmsg("%s (PID %d) was terminated by exception %X",
- procname, pid, WTERMSIG(exitstatus)),
- errhint("See /include/ntstatus.h for a description of the hex value.")));
+ (errmsg("%s (PID %d) was terminated by signal %d",
+ procname, pid, WTERMSIG(exitstatus))));
#endif
else
ereport(lev,