[cvs] bogofilter/src sighandler.c,1.3,1.4

Matthias Andree matthias.andree at gmx.de
Wed Mar 23 00:45:08 CET 2005


David Relson <relson at users.sourceforge.net> writes:

> Update of /cvsroot/bogofilter/bogofilter/src
> In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3999
>
> Modified Files:
> 	sighandler.c 
> Log Message:
> Ensure struct sa is empty.
>
> Index: sighandler.c
> ===================================================================
> RCS file: /cvsroot/bogofilter/bogofilter/src/sighandler.c,v
> retrieving revision 1.3
> retrieving revision 1.4
> diff -u -d -r1.3 -r1.4
> --- sighandler.c	9 Mar 2005 01:01:33 -0000	1.3
> +++ sighandler.c	22 Mar 2005 04:41:50 -0000	1.4
> @@ -29,6 +29,7 @@
>  static void mysignal(int sig, void (*hdl)(int)) {
>      struct sigaction sa;
>  
> +    memset( &sa, 0, sizeof(sa));
>      sa.sa_handler = hdl;
>      sigemptyset(&sa.sa_mask);
>      sa.sa_flags = SA_RESTART;

Well, we initialize all POSIX-specified fields. sa_sigaction remains
uninitialized because it is a. unused b. shared with sa_handler on some
systems (in a union), so valgrind warnings about uninitialized fields
are bogus. Perhaps Mandrake Cooker complaints should be taken with not
only a pinch but a whole shovelful of salt.

I am also seeing loads of GCC 4 warnings that I do not fix because I
know they are bogus.

-- 
Matthias Andree
_______________________________________________
Bogofilter-dev mailing list
Bogofilter-dev at bogofilter.org
http://www.bogofilter.org/mailman/listinfo/bogofilter-dev



More information about the bogofilter-dev mailing list