Update process termination message to display signal number and name
authorBruce Momjian <bruce@momjian.us>
Mon, 29 Jan 2007 20:17:40 +0000 (20:17 +0000)
committerBruce Momjian <bruce@momjian.us>
Mon, 29 Jan 2007 20:17:40 +0000 (20:17 +0000)
from exec.c and postmaster.c.

src/backend/postmaster/postmaster.c
src/port/exec.c

index 29271f9e4635778fe5a50cfd81cc1f44c4ff4fe8..43d9212358b97262ada2ec3e2221d98c3b83f857 100644 (file)
@@ -37,7 +37,7 @@
  *
  *
  * 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
  *
@@ -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
          "server process" */
-               (errmsg("%s (PID %d) was terminated by signal %s (%d)",
-                       procname, pid,
+               (errmsg("%s (PID %d) was terminated by signal %d: %s",
+                       procname, pid, WTERMSIG(exitstatus),
                        WTERMSIG(exitstatus) < NSIG ?
-                       sys_siglist[WTERMSIG(exitstatus)] : "(unknown)",
-                       WTERMSIG(exitstatus))));
+                       sys_siglist[WTERMSIG(exitstatus)] : "(unknown)")));
 #else
        ereport(lev,
 
index 26294cdf4a23403ac158f42304b821e518a31038..e92dbde1a29ac6d3943fa910f962ed64637aa406 100644 (file)
@@ -9,7 +9,7 @@
  *
  *
  * 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"),
                  WTERMSIG(exitstatus));
 #elif defined(HAVE_DECL_SYS_SIGLIST) && HAVE_DECL_SYS_SIGLIST
-       log_error(_("child process was terminated by signal %s"),
-                 WTERMSIG(exitstatus) < NSIG ?
-                 sys_siglist[WTERMSIG(exitstatus)] : "(unknown)");
+   {
+       char str[256];
+
+       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
        log_error(_("child process was terminated by signal %d"),
                  WTERMSIG(exitstatus));