diff options
author | Greg Stein <gstein@apache.org> | 2001-02-11 01:44:40 +0100 |
---|---|---|
committer | Greg Stein <gstein@apache.org> | 2001-02-11 01:44:40 +0100 |
commit | 39793c7fca5cc9e319202966ac0d19c1a262dd34 (patch) | |
tree | 88d2b6817e73fc5433a3535387460bbaae232bca /server | |
parent | Cleanup the rest of the warnings that appear when compileing with (diff) | |
download | apache2-39793c7fca5cc9e319202966ac0d19c1a262dd34.tar.xz apache2-39793c7fca5cc9e319202966ac0d19c1a262dd34.zip |
toss the signal description stuff from unixd.[ch], beosd.h, and spmt_os2.
use the new functionality in APR.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88079 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'server')
-rw-r--r-- | server/mpm/spmt_os2/spmt_os2.c | 132 | ||||
-rw-r--r-- | server/mpm_common.c | 26 |
2 files changed, 10 insertions, 148 deletions
diff --git a/server/mpm/spmt_os2/spmt_os2.c b/server/mpm/spmt_os2/spmt_os2.c index 3c5bde5836..0119e09446 100644 --- a/server/mpm/spmt_os2/spmt_os2.c +++ b/server/mpm/spmt_os2/spmt_os2.c @@ -271,137 +271,6 @@ static int wait_or_timeout(apr_wait_t *status) } -#if defined(NSIG) -#define NumSIG NSIG -#elif defined(_NSIG) -#define NumSIG _NSIG -#elif defined(__NSIG) -#define NumSIG __NSIG -#else -#define NumSIG 32 /* for 1998's unixes, this is still a good assumption */ -#endif - -#ifdef SYS_SIGLIST /* platform has sys_siglist[] */ -#define INIT_SIGLIST() /*nothing*/ -#else /* platform has no sys_siglist[], define our own */ -#define SYS_SIGLIST ap_sys_siglist -#define INIT_SIGLIST() siglist_init(); - -const char *ap_sys_siglist[NumSIG]; - -static void siglist_init(void) -{ - int sig; - - ap_sys_siglist[0] = "Signal 0"; -#ifdef SIGHUP - ap_sys_siglist[SIGHUP] = "Hangup"; -#endif -#ifdef SIGINT - ap_sys_siglist[SIGINT] = "Interrupt"; -#endif -#ifdef SIGQUIT - ap_sys_siglist[SIGQUIT] = "Quit"; -#endif -#ifdef SIGILL - ap_sys_siglist[SIGILL] = "Illegal instruction"; -#endif -#ifdef SIGTRAP - ap_sys_siglist[SIGTRAP] = "Trace/BPT trap"; -#endif -#ifdef SIGIOT - ap_sys_siglist[SIGIOT] = "IOT instruction"; -#endif -#ifdef SIGABRT - ap_sys_siglist[SIGABRT] = "Abort"; -#endif -#ifdef SIGEMT - ap_sys_siglist[SIGEMT] = "Emulator trap"; -#endif -#ifdef SIGFPE - ap_sys_siglist[SIGFPE] = "Arithmetic exception"; -#endif -#ifdef SIGKILL - ap_sys_siglist[SIGKILL] = "Killed"; -#endif -#ifdef SIGBUS - ap_sys_siglist[SIGBUS] = "Bus error"; -#endif -#ifdef SIGSEGV - ap_sys_siglist[SIGSEGV] = "Segmentation fault"; -#endif -#ifdef SIGSYS - ap_sys_siglist[SIGSYS] = "Bad system call"; -#endif -#ifdef SIGPIPE - ap_sys_siglist[SIGPIPE] = "Broken pipe"; -#endif -#ifdef SIGALRM - ap_sys_siglist[SIGALRM] = "Alarm clock"; -#endif -#ifdef SIGTERM - ap_sys_siglist[SIGTERM] = "Terminated"; -#endif -#ifdef SIGUSR1 - ap_sys_siglist[SIGUSR1] = "User defined signal 1"; -#endif -#ifdef SIGUSR2 - ap_sys_siglist[SIGUSR2] = "User defined signal 2"; -#endif -#ifdef SIGCLD - ap_sys_siglist[SIGCLD] = "Child status change"; -#endif -#ifdef SIGCHLD - ap_sys_siglist[SIGCHLD] = "Child status change"; -#endif -#ifdef SIGPWR - ap_sys_siglist[SIGPWR] = "Power-fail restart"; -#endif -#ifdef SIGWINCH - ap_sys_siglist[SIGWINCH] = "Window changed"; -#endif -#ifdef SIGURG - ap_sys_siglist[SIGURG] = "urgent socket condition"; -#endif -#ifdef SIGPOLL - ap_sys_siglist[SIGPOLL] = "Pollable event occurred"; -#endif -#ifdef SIGIO - ap_sys_siglist[SIGIO] = "socket I/O possible"; -#endif -#ifdef SIGSTOP - ap_sys_siglist[SIGSTOP] = "Stopped (signal)"; -#endif -#ifdef SIGTSTP - ap_sys_siglist[SIGTSTP] = "Stopped"; -#endif -#ifdef SIGCONT - ap_sys_siglist[SIGCONT] = "Continued"; -#endif -#ifdef SIGTTIN - ap_sys_siglist[SIGTTIN] = "Stopped (tty input)"; -#endif -#ifdef SIGTTOU - ap_sys_siglist[SIGTTOU] = "Stopped (tty output)"; -#endif -#ifdef SIGVTALRM - ap_sys_siglist[SIGVTALRM] = "virtual timer expired"; -#endif -#ifdef SIGPROF - ap_sys_siglist[SIGPROF] = "profiling timer expired"; -#endif -#ifdef SIGXCPU - ap_sys_siglist[SIGXCPU] = "exceeded cpu limit"; -#endif -#ifdef SIGXFSZ - ap_sys_siglist[SIGXFSZ] = "exceeded file size limit"; -#endif - for (sig=0; sig < sizeof(ap_sys_siglist)/sizeof(ap_sys_siglist[0]); ++sig) - if (ap_sys_siglist[sig] == NULL) - ap_sys_siglist[sig] = ""; -} -#endif /* platform has sys_siglist[] */ - /* handle all varieties of core dumping signals */ static void sig_coredump(int sig) @@ -1271,7 +1140,6 @@ static void spmt_os2_pre_config(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t static void spmt_os2_hooks(apr_pool_t *p) { - INIT_SIGLIST(); /* TODO: set one_process properly */ one_process = 0; ap_hook_pre_config(spmt_os2_pre_config, NULL, NULL, APR_HOOK_MIDDLE); diff --git a/server/mpm_common.c b/server/mpm_common.c index dc0081533e..bdf499c49b 100644 --- a/server/mpm_common.c +++ b/server/mpm_common.c @@ -69,7 +69,7 @@ #include "apr.h" #include "apr_thread_proc.h" -#include "apr_general.h" /* for signal stuff */ +#include "apr_signal.h" #include "httpd.h" #include "http_config.h" @@ -214,6 +214,9 @@ void ap_wait_or_timeout(apr_wait_t *status, apr_proc_t *ret, apr_pool_t *p) void ap_process_child_status(apr_proc_t *pid, apr_wait_t status) { + int signum = WTERMSIG(status); + const char *sigdesc = apr_signal_get_description(signum); + /* Child died... if it died due to a fatal error, * we should simply bail out. */ @@ -225,41 +228,32 @@ void ap_process_child_status(apr_proc_t *pid, apr_wait_t status) (long)pid->pid); exit(APEXIT_CHILDFATAL); } + if (WIFSIGNALED(status)) { - switch (WTERMSIG(status)) { + switch (signum) { case SIGTERM: case SIGHUP: case SIGWINCH: case SIGKILL: break; default: -#ifdef SYS_SIGLIST #ifdef WCOREDUMP if (WCOREDUMP(status)) { ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE, 0, ap_server_conf, "child pid %ld exit signal %s (%d), " "possible coredump in %s", - (long)pid->pid, (WTERMSIG(status) >= NumSIG) ? "" : - SYS_SIGLIST[WTERMSIG(status)], WTERMSIG(status), + (long)pid->pid, sigdesc, signum, ap_coredump_dir); } - else { + else #endif + { ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE, 0, ap_server_conf, "child pid %ld exit signal %s (%d)", - (long)pid->pid, - SYS_SIGLIST[WTERMSIG(status)], WTERMSIG(status)); -#ifdef WCOREDUMP + (long)pid->pid, sigdesc, signum); } -#endif -#else - ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE, - 0, ap_server_conf, - "child pid %ld exit signal %d", - (long)pid->pid, WTERMSIG(status)); -#endif } } } |