httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Laurie <...@gonzo.ben.algroup.co.uk>
Subject sigaction tryout patches
Date Thu, 09 May 1996 17:49:01 GMT
OK, I have no idea whether this will help or not, but here's a patch to use
sigaction() instead of signal(). It seems to work for me but does it cure the
non-dying children problem? I don't know!

Index: http_main.c
===================================================================
RCS file: /export/home/cvs/apache/src/http_main.c,v
retrieving revision 1.25
diff -c -r1.25 http_main.c
*** http_main.c 1996/05/07 18:29:34     1.25
--- http_main.c 1996/05/09 18:25:17
***************
*** 962,976 ****
  #endif
  }

! void set_signals() {
!       if(!one_process)
        {
!           signal(SIGSEGV,(void (*)())seg_fault);
        signal(SIGBUS,(void (*)())bus_error);
        }
!     signal(SIGTERM,(void (*)())sig_term);
!     signal(SIGHUP,(void (*)())restart);
! }

  /*****************************************************************
   * Connection structures and accounting...
--- 962,985 ----
  #endif
  }

! void set_signals()
!     {
!     struct sigaction sa;
!
!     if(!one_process)
        {
!       signal(SIGSEGV,(void (*)())seg_fault);
        signal(SIGBUS,(void (*)())bus_error);
        }
!
!     memset(&sa,0,sizeof sa);
!     sa.sa_handler=(void (*)())sig_term;
!     if(sigaction(SIGTERM,&sa,NULL) < 0)
!         log_unixerr("sigaction(SIGTERM)", NULL, NULL, server_conf);
!     sa.sa_handler=(void (*)())restart;
!     if(sigaction(SIGHUP,&sa,NULL) < 0)
!         log_unixerr("sigaction(SIGHUP)", NULL, NULL, server_conf);
!     }

  /*****************************************************************
   * Connection structures and accounting...

-- 
Ben Laurie                  Phone: +44 (181) 994 6435
Freelance Consultant and    Fax:   +44 (181) 994 6472
Technical Director          Email: ben@algroup.co.uk
A.L. Digital Ltd,           URL: http://www.algroup.co.uk
London, England.

Mime
View raw message