Commit b97ad9ea authored by Richard M. Stallman's avatar Richard M. Stallman

(sigchld_handler, status_message): Handle a NULL in sys_siglist.

parent d0b81713
...@@ -308,11 +308,18 @@ status_message (status) ...@@ -308,11 +308,18 @@ status_message (status)
if (EQ (symbol, Qsignal) || EQ (symbol, Qstop)) if (EQ (symbol, Qsignal) || EQ (symbol, Qstop))
{ {
char *signame = 0;
if (code < NSIG)
{
#ifndef VMS #ifndef VMS
string = build_string (code < NSIG ? sys_siglist[code] : "unknown"); signame = sys_siglist[code];
#else #else
string = build_string (code < NSIG ? sys_errlist[code] : "unknown"); signame = sys_errlist[code];
#endif #endif
}
if (signame == 0)
signame = "unknown";
string = build_string (signame);
string2 = build_string (coredump ? " (core dumped)\n" : "\n"); string2 = build_string (coredump ? " (core dumped)\n" : "\n");
XSTRING (string)->data[0] = DOWNCASE (XSTRING (string)->data[0]); XSTRING (string)->data[0] = DOWNCASE (XSTRING (string)->data[0]);
return concat2 (string, string2); return concat2 (string, string2);
...@@ -2827,11 +2834,23 @@ sigchld_handler (signo) ...@@ -2827,11 +2834,23 @@ sigchld_handler (signo)
if (WIFEXITED (w)) if (WIFEXITED (w))
synch_process_retcode = WRETCODE (w); synch_process_retcode = WRETCODE (w);
else if (WIFSIGNALED (w)) else if (WIFSIGNALED (w))
{
int code = WTERMSIG (w);
char *signame = 0;
if (code < NSIG)
{
#ifndef VMS #ifndef VMS
synch_process_death = (char *) sys_siglist[WTERMSIG (w)]; signame = sys_siglist[code];
#else #else
synch_process_death = sys_errlist[WTERMSIG (w)]; signame = sys_errlist[code];
#endif #endif
}
if (signame == 0)
signame = "unknown";
synch_process_death = signame;
}
/* Tell wait_reading_process_input that it needs to wake up and /* Tell wait_reading_process_input that it needs to wake up and
look around. */ look around. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment