diff options
| author | Paul Buetow <paul@buetow.org> | 2010-11-21 17:01:59 +0000 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2010-11-21 17:01:59 +0000 |
| commit | b891420946d5269cc326d67555c6aab3db41a01a (patch) | |
| tree | f6c5e7d6dbf18ec8c0ea9ec0b037251df46b4cbb /yhttpd/src/sign.cpp | |
| parent | a537e8323d932125232c305f9573daef89aef0df (diff) | |
added yhttpd and ycurses trunk versions
Diffstat (limited to 'yhttpd/src/sign.cpp')
| -rw-r--r-- | yhttpd/src/sign.cpp | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/yhttpd/src/sign.cpp b/yhttpd/src/sign.cpp new file mode 100644 index 0000000..efb28d7 --- /dev/null +++ b/yhttpd/src/sign.cpp @@ -0,0 +1,54 @@ +#ifndef SIGN_CPP +#define SIGN_CPP + +#include "sign.h" + +void +sign::clean_template_cache(int i_param) +{ + wrap::HTML->clear_cache(); +} + + +#ifdef CTCSEGV +void +sign::sigsev_received(int i_param) +{ + wrap::system_message(SIGNSEG); +} +#endif + +void +sign::terminate_received(int i_param) +{ + +#ifdef NCURSES + + mvprintw( 21,2, "Good bye !"); + wrap::NCUR->close_ncurses(); + +#endif + + exit(0); +} + +void +sign::init_signal_handlers() +{ + // Ignore SIGPIPE. otherwise the server will shut down with "Broken pipe" if + // a client unexpected disconnects himself from a SOCK_STREAM. + signal(SIGPIPE, SIG_IGN); + + signal(SIGUSR1, clean_template_cache); +#ifdef CTCSEGV + + signal(SIGSEGV, sigsev_received); +#endif + + signal(SIGHUP, terminate_received); + signal(SIGINT, terminate_received); + signal(SIGTERM, terminate_received); + //signal(SIGWINCH, ); +} + +#endif |
