catch SIGINT in order to get more gmon.out profiles (merged r 24790)

This commit is contained in:
Gunter Labes 2008-03-19 07:41:20 +00:00
parent 913d7c90ee
commit 9701e777c3

View file

@ -63,6 +63,7 @@
#ifndef SIGHUP
#define SIGHUP 20
#endif
// FIXME: should define SIGINT here too, but to what?
sig_atomic_t config_reload = 0;
@ -71,6 +72,12 @@ void reload_config(int signal) {
config_reload = 1;
}
void exit_sigint(int signal) {
assert(signal == SIGINT);
LOG_SERVER << "SIGINT caught, exiting without cleanup immediately.\n";
exit(1);
}
namespace {
// we take profiling info on every n requests
@ -272,6 +279,7 @@ server::server(int port, input_stream& input, const std::string& config_file, si
{
load_config();
signal(SIGHUP, reload_config);
signal(SIGINT, exit_sigint);
}
void server::send_error(network::connection sock, const char* msg) const