Wanting a pre-db4 bogofilter

Jef Poskanzer jef at acme.com
Fri Feb 25 19:49:55 CET 2005


>Good catch Jef!
>
>I've just whipped together code to catch SIGINT, SIGKILL, and SIGTERM,
>and exit cleanly.  Need SIGSEGV, SIGFPE, SIGILL, and SIGABRT be dealt
>with ???

I took a look at what I do in my various programs.  I like to catch
SIGINT and SIGTERM, and sometimes SIGHUP.  I don't bother with SIGKILL
(actually the man page implies you can't catch it).  I call sigset() if
it's available and signal() otherwise.  You have to be a little careful
about what kinds of things you do in the handler routine - safest is
to just set a flag saying 'a signal happened', and deal with it somewhere
back in the main thread.

I also usually set SIGPIPE to SIG_IGN, so that broken pipes show up
as EPIPE error returns from the read() or write() instead of as signals.
That tends to be easier to deal with.
_______________________________________________
Bogofilter mailing list
Bogofilter at bogofilter.org
http://www.bogofilter.org/mailman/listinfo/bogofilter



More information about the Bogofilter mailing list