summaryrefslogtreecommitdiff
path: root/src/port/exec.c
diff options
context:
space:
mode:
authorBruce Momjian2007-01-28 01:12:05 +0000
committerBruce Momjian2007-01-28 01:12:05 +0000
commit82480fc2542fc92bdbc917060b0d578120e9997d (patch)
tree134525a3b173b03ae93ac8b95c3bf07e27d3ae7c /src/port/exec.c
parent3ec7ae1b67da4e9094eaad5781e0f39ecc395546 (diff)
Use sys_siglist[] to print out signal names for signal exits, rather
than just numbers.
Diffstat (limited to 'src/port/exec.c')
-rw-r--r--src/port/exec.c12
1 files changed, 8 insertions, 4 deletions
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