summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/backend/postmaster/postmaster.c24
-rw-r--r--src/include/pg_config.h.in3
-rw-r--r--src/port/exec.c12
3 files changed, 28 insertions, 11 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,
diff --git a/src/include/pg_config.h.in b/src/include/pg_config.h.in
index a8e8014b8a6..52a11c09b27 100644
--- a/src/include/pg_config.h.in
+++ b/src/include/pg_config.h.in
@@ -478,6 +478,9 @@
/* Define to 1 if you have the <sys/shm.h> header file. */
#undef HAVE_SYS_SHM_H
+/* Define to 1 if you have the global variable 'char *sys_siglist[]'. */
+#undef HAVE_SYS_SIGLIST
+
/* Define to 1 if you have the <sys/socket.h> header file. */
#undef HAVE_SYS_SOCKET_H
diff --git a/src/port/exec.c b/src/port/exec.c
index 0caf0287919..c97d70751f9 100644
--- a/src/port/exec.c
+++ b/src/port/exec.c
@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/port/exec.c,v 1.48 2007/01/23 03:31:33 momjian Exp $
+ * $PostgreSQL: pgsql/src/port/exec.c,v 1.49 2007/01/28 01:12:05 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -582,11 +582,15 @@ pclose_check(FILE *stream)
log_error(_("child process exited with exit code %d"),
WEXITSTATUS(exitstatus));
else if (WIFSIGNALED(exitstatus))
-#ifndef WIN32
- log_error(_("child process was terminated by signal %d"),
+#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."),
WTERMSIG(exitstatus));
+#elif defined(HAVE_SYS_SIGLIST)
+ log_error(_("child process was terminated by signal: %s"),
+ WTERMSIG(exitstatus) < NSIG ?
+ sys_siglist[WTERMSIG(exitstatus)] : "unknown signal");
#else
- log_error(_("child process was terminated by exception %X\nSee /include/ntstatus.h for a description of the hex value."),
+ log_error(_("child process was terminated by signal %d"),
WTERMSIG(exitstatus));
#endif
else