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 Re: SIGACTION patch
Date Sat, 11 May 1996 21:34:35 GMT
Jim Jagielski wrote:
> 
> Here's a sigaction patch that should patch cleanly against the current
> CVS tree. I added a compile define in case some systems don't have or need
> to use sigaction() over signal():

I don't understand why my patch didn't patch cleanly ... it was diffed against
the current tree. Strange.

Anyway, do I gather from the tenor of these notes that the patch works? (I find
it slightly surprising since I'd have thought that those platforms that
supported sigaction would just implement signal in terms of it but I was
clutching at straws!).

Cheers,

Ben.

> ? apache/src/a.patch
> Index: apache/src/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/11 16:26:38
> ***************
> *** 963,975 ****
>   }
>   
>   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);
>   }
>   
>   /*****************************************************************
> --- 963,987 ----
>   }
>   
>   void set_signals() {
> ! #ifndef NO_USE_SIGACTION
> !     struct sigaction sa;
> ! #endif
> !     if(!one_process) {
> ! 	signal(SIGSEGV,(void (*)())seg_fault);
>       	signal(SIGBUS,(void (*)())bus_error);
> !     }
> ! #ifdef NO_USE_SIGACTION
>       signal(SIGTERM,(void (*)())sig_term);
>       signal(SIGHUP,(void (*)())restart);
> + #else
> +     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);
> + #endif
>   }
>   
>   /*****************************************************************
> -- 
> Jim Jagielski  << jim@jaguNET.com >>   |      "That's a Smith & Wesson,
>   **  jaguNET Access Services  **      |       and you've had your six" 
>       Email: info@jaguNET.com          |             - James Bond
> ++    http://www.jaguNET.com/         +++      Voice/Fax: 410-931-3157       ++

-- 
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