Author: martin
Date: Fri Feb 1 00:50:09 2008
New Revision: 617373
URL: http://svn.apache.org/viewvc?rev=617373&view=rev
Log:
Avoid core dumps by getting the signal_description only if
a process actually terminated on a signal. Update status
only on a valid wait response.
Modified:
httpd/httpd/trunk/server/mpm_common.c
Modified: httpd/httpd/trunk/server/mpm_common.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm_common.c?rev=617373&r1=617372&r2=617373&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm_common.c (original)
+++ httpd/httpd/trunk/server/mpm_common.c Fri Feb 1 00:50:09 2008
@@ -138,7 +138,8 @@
waitret = apr_proc_wait(&proc, &status, &why, APR_NOWAIT);
if (waitret != APR_CHILD_NOTDONE) {
#ifdef AP_MPM_WANT_PROCESS_CHILD_STATUS
- ap_process_child_status(&proc, why, status);
+ if (waitret == APR_CHILD_DONE)
+ ap_process_child_status(&proc, why, status);
#endif
return 1;
}
@@ -417,7 +418,7 @@
int ap_process_child_status(apr_proc_t *pid, apr_exit_why_e why, int status)
{
int signum = status;
- const char *sigdesc = apr_signal_description_get(signum);
+ const char *sigdesc;
/* Child died... if it died due to a fatal error,
* we should simply bail out. The caller needs to
@@ -445,6 +446,8 @@
}
if (APR_PROC_CHECK_SIGNALED(why)) {
+ sigdesc = apr_signal_description_get(signum);
+
switch (signum) {
case SIGTERM:
case SIGHUP:
|