chuck 96/06/07 13:02:05
Modified: src http_main.c
Log:
Reviewed by: Chuck Murcko
Submitted by: Cliff Skolnick
Obtained from: [EMAIL PROTECTED]
Sending a SIGTERM (as user root using /bin/sh as
shell) doesn't terminate apache under Solaris 2.5
(but other SVR4 systems are probably affected, too).
After sending the SIGTERM, /usr/proc/bin/psig on the
pid of the apache master process shows
TERM blocked,caught 0
As far is I understand it, the problem is caused by
jumping out of a signal handler using setjmp/longjmp
instead of sigsetjmp/siglongjmp.
Revision Changes Path
1.34 +8 -1 apache/src/http_main.c
Index: http_main.c
===================================================================
RCS file: /export/home/cvs/apache/src/http_main.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -C3 -r1.33 -r1.34
*** http_main.c 1996/06/07 19:51:16 1.33
--- http_main.c 1996/06/07 20:02:03 1.34
***************
*** 821,836 ****
static int wait_or_timeout_retval = -1;
static void longjmp_out_of_alarm (int sig) {
longjmp (wait_timeout_buf, 1);
}
int wait_or_timeout (int *status)
{
wait_or_timeout_retval = -1;
if (setjmp(wait_timeout_buf) != 0) {
errno = ETIMEDOUT;
- alarm(0);
return wait_or_timeout_retval;
}
--- 821,843 ----
static int wait_or_timeout_retval = -1;
static void longjmp_out_of_alarm (int sig) {
+ #ifdef NEXT
longjmp (wait_timeout_buf, 1);
+ #else
+ siglongjmp (wait_timeout_buf, 1);
+ #endif
}
int wait_or_timeout (int *status)
{
wait_or_timeout_retval = -1;
+ #if defined(NEXT)
if (setjmp(wait_timeout_buf) != 0) {
+ #else
+ if (sigsetjmp(wait_timeout_buf, 1) != 0) {
+ #endif
errno = ETIMEDOUT;
return wait_or_timeout_retval;
}