You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by gs...@apache.org on 2001/02/11 01:44:40 UTC
cvs commit: httpd-2.0/os/unix config.m4 unixd.c unixd.h
gstein 01/02/10 16:44:40
Modified: server mpm_common.c
server/mpm/spmt_os2 spmt_os2.c
os/beos beosd.h
os/unix config.m4 unixd.c unixd.h
Log:
toss the signal description stuff from unixd.[ch], beosd.h, and spmt_os2.
use the new functionality in APR.
Revision Changes Path
1.40 +10 -16 httpd-2.0/server/mpm_common.c
Index: mpm_common.c
===================================================================
RCS file: /home/cvs/httpd-2.0/server/mpm_common.c,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -u -r1.39 -r1.40
--- mpm_common.c 2001/02/08 07:44:18 1.39
+++ mpm_common.c 2001/02/11 00:44:39 1.40
@@ -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_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 @@
(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
}
}
}
1.83 +0 -132 httpd-2.0/server/mpm/spmt_os2/spmt_os2.c
Index: spmt_os2.c
===================================================================
RCS file: /home/cvs/httpd-2.0/server/mpm/spmt_os2/spmt_os2.c,v
retrieving revision 1.82
retrieving revision 1.83
diff -u -u -r1.82 -r1.83
--- spmt_os2.c 2001/02/10 04:27:58 1.82
+++ spmt_os2.c 2001/02/11 00:44:39 1.83
@@ -271,137 +271,6 @@
}
-#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_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);
1.7 +3 -15 httpd-2.0/os/beos/beosd.h
Index: beosd.h
===================================================================
RCS file: /home/cvs/httpd-2.0/os/beos/beosd.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -u -r1.6 -r1.7
--- beosd.h 2000/03/31 09:17:09 1.6
+++ beosd.h 2001/02/11 00:44:39 1.7
@@ -56,8 +56,8 @@
* University of Illinois, Urbana-Champaign.
*/
-#ifndef UNIXD_H
-#define UNIXD_H
+#ifndef BEOSD_H
+#define BEOSD_H
/* common stuff that beos MPMs will want */
@@ -84,18 +84,6 @@
const char *beosd_set_user(cmd_parms *cmd, void *dummy, char *arg);
const char *beosd_set_group(cmd_parms *cmd, void *dummy, char *arg);
-#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
-
-#define INIT_SIGLIST() /* nothing */
-
#define beosd_killpg(x, y) (kill (-(x), (y)))
#define UNIX_DAEMON_COMMANDS \
@@ -104,4 +92,4 @@
{ "Group", beosd_set_group, NULL, RSRC_CONF, TAKE1, \
"Effective group id for this server"}, \
-#endif
+#endif /* BEOSD_H */
1.4 +1 -7 httpd-2.0/os/unix/config.m4
Index: config.m4
===================================================================
RCS file: /home/cvs/httpd-2.0/os/unix/config.m4,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -u -r1.3 -r1.4
--- config.m4 2001/02/10 14:13:50 1.3
+++ config.m4 2001/02/11 00:44:40 1.4
@@ -3,11 +3,5 @@
AC_CHECK_HEADERS(sys/time.h sys/resource.h)
- AC_CHECK_FUNCS( \
- setsid \
- killpg \
- )
-
- dnl XXX - This doesn't deal with _sys_siglist. Maybe have to roll our own
- AC_DECL_SYS_SIGLIST
+ AC_CHECK_FUNCS(setsid, killpg)
fi
1.35 +0 -119 httpd-2.0/os/unix/unixd.c
Index: unixd.c
===================================================================
RCS file: /home/cvs/httpd-2.0/os/unix/unixd.c,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -u -r1.34 -r1.35
--- unixd.c 2001/02/08 07:44:15 1.34
+++ unixd.c 2001/02/11 00:44:40 1.35
@@ -241,125 +241,6 @@
/* } */
}
-#ifdef NEED_AP_SYS_SIGLIST
-
-const char *ap_sys_siglist[NumSIG];
-
-#define store_str(array,index,string) \
-(ap_assert(index < (sizeof(array)/sizeof(array[0]))),array[index]=string)
-
-void unixd_siglist_init(void)
-{
- int sig;
-
- ap_sys_siglist[0] = "Signal 0";
-#ifdef SIGHUP
- store_str(ap_sys_siglist,SIGHUP,"Hangup");
-#endif
-#ifdef SIGINT
- store_str(ap_sys_siglist,SIGINT,"Interrupt");
-#endif
-#ifdef SIGQUIT
- store_str(ap_sys_siglist,SIGQUIT,"Quit");
-#endif
-#ifdef SIGILL
- store_str(ap_sys_siglist,SIGILL,"Illegal instruction");
-#endif
-#ifdef SIGTRAP
- store_str(ap_sys_siglist,SIGTRAP,"Trace/BPT trap");
-#endif
-#ifdef SIGIOT
- store_str(ap_sys_siglist,SIGIOT,"IOT instruction");
-#endif
-#ifdef SIGABRT
- store_str(ap_sys_siglist,SIGABRT,"Abort");
-#endif
-#ifdef SIGEMT
- store_str(ap_sys_siglist,SIGEMT,"Emulator trap");
-#endif
-#ifdef SIGFPE
- store_str(ap_sys_siglist,SIGFPE,"Arithmetic exception");
-#endif
-#ifdef SIGKILL
- store_str(ap_sys_siglist,SIGKILL,"Killed");
-#endif
-#ifdef SIGBUS
- store_str(ap_sys_siglist,SIGBUS,"Bus error");
-#endif
-#ifdef SIGSEGV
- store_str(ap_sys_siglist,SIGSEGV,"Segmentation fault");
-#endif
-#ifdef SIGSYS
- store_str(ap_sys_siglist,SIGSYS,"Bad system call");
-#endif
-#ifdef SIGPIPE
- store_str(ap_sys_siglist,SIGPIPE,"Broken pipe");
-#endif
-#ifdef SIGALRM
- store_str(ap_sys_siglist,SIGALRM,"Alarm clock");
-#endif
-#ifdef SIGTERM
- store_str(ap_sys_siglist,SIGTERM,"Terminated");
-#endif
-#ifdef SIGUSR1
- store_str(ap_sys_siglist,SIGUSR1,"User defined signal 1");
-#endif
-#ifdef SIGUSR2
- store_str(ap_sys_siglist,SIGUSR2,"User defined signal 2");
-#endif
-#ifdef SIGCLD
- store_str(ap_sys_siglist,SIGCLD,"Child status change");
-#endif
-#ifdef SIGCHLD
- store_str(ap_sys_siglist,SIGCHLD,"Child status change");
-#endif
-#ifdef SIGPWR
- store_str(ap_sys_siglist,SIGPWR,"Power-fail restart");
-#endif
-#ifdef SIGWINCH
- store_str(ap_sys_siglist,SIGWINCH,"Window changed");
-#endif
-#ifdef SIGURG
- store_str(ap_sys_siglist,SIGURG,"urgent socket condition");
-#endif
-#ifdef SIGPOLL
- store_str(ap_sys_siglist,SIGPOLL,"Pollable event occurred");
-#endif
-#ifdef SIGIO
- store_str(ap_sys_siglist,SIGIO,"socket I/O possible");
-#endif
-#ifdef SIGSTOP
- store_str(ap_sys_siglist,SIGSTOP,"Stopped (signal)");
-#endif
-#ifdef SIGTSTP
- store_str(ap_sys_siglist,SIGTSTP,"Stopped");
-#endif
-#ifdef SIGCONT
- store_str(ap_sys_siglist,SIGCONT,"Continued");
-#endif
-#ifdef SIGTTIN
- store_str(ap_sys_siglist,SIGTTIN,"Stopped (tty input)");
-#endif
-#ifdef SIGTTOU
- store_str(ap_sys_siglist,SIGTTOU,"Stopped (tty output)");
-#endif
-#ifdef SIGVTALRM
- store_str(ap_sys_siglist,SIGVTALRM,"virtual timer expired");
-#endif
-#ifdef SIGPROF
- store_str(ap_sys_siglist,SIGPROF,"profiling timer expired");
-#endif
-#ifdef SIGXCPU
- store_str(ap_sys_siglist,SIGXCPU,"exceeded cpu limit");
-#endif
-#ifdef SIGXFSZ
- store_str(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 /* NEED_AP_SYS_SIGLIST */
AP_DECLARE(void) unixd_set_rlimit(cmd_parms *cmd, struct rlimit **plimit,
const char *arg, const char * arg2, int type)
1.19 +0 -24 httpd-2.0/os/unix/unixd.h
Index: unixd.h
===================================================================
RCS file: /home/cvs/httpd-2.0/os/unix/unixd.h,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -u -r1.18 -r1.19
--- unixd.h 2001/01/19 07:04:26 1.18
+++ unixd.h 2001/02/11 00:44:40 1.19
@@ -112,30 +112,6 @@
const char *arg, const char * arg2, int type);
#endif
-/* Information on signals for the various platforms */
-
-#if defined(NSIG)
-#define NumSIG NSIG
-#elif defined(_NSIG)
-#define NumSIG _NSIG
-#elif defined(__NSIG)
-#define NumSIG __NSIG
-#else
-#define NumSIG 33 /* breaks on OS/390 with < 33; 32 is o.k. for most */
-#endif
-
-#ifdef SYS_SIGLIST /* platform has sys_siglist[] */
-#define INIT_SIGLIST() /* nothing */
-#elif defined(SYS_SIGLIST_DECLARED) /* from autoconf */
-#define INIT_SIGLIST() /* nothing */
-#define SYS_SIGLIST sys_siglist
-#else
-#define NEED_AP_SYS_SIGLIST
-extern const char *ap_sys_siglist[NumSIG];
-#define SYS_SIGLIST ap_sys_siglist
-void unixd_siglist_init(void);
-#define INIT_SIGLIST() unixd_siglist_init();
-#endif /* platform has sys_siglist[] */
#ifdef HAVE_KILLPG
#define unixd_killpg(x, y) (killpg ((x), (y)))