mail[Wesnoth-commits] r24790 - /trunk/src/server/server.cpp


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by martinxyz on March 19, 2008 - 00:15:
Author: martinxyz
Date: Wed Mar 19 00:15:05 2008
New Revision: 24790

URL: http://svn.gna.org/viewcvs/wesnoth?rev=24790&view=rev
Log:
catch SIGINT in order to get more gmon.out profiles

Modified:
    trunk/src/server/server.cpp

Modified: trunk/src/server/server.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/server/server.cpp?rev=24790&r1=24789&r2=24790&view=diff
==============================================================================
--- trunk/src/server/server.cpp (original)
+++ trunk/src/server/server.cpp Wed Mar 19 00:15:05 2008
@@ -61,12 +61,19 @@
 #ifndef SIGHUP
 #define SIGHUP 20
 #endif
+// FIXME: should define SIGINT here too, but to what?
 
 sig_atomic_t config_reload = 0;
 
 void reload_config(int signal) {
        assert(signal == SIGHUP);
        config_reload = 1;
+}
+
+void exit_sigint(int signal) {
+       assert(signal == SIGINT);
+       LOG_SERVER << "SIGINT caught, exiting without cleanup immediately.\n";
+       exit(1);
 }
 
 namespace {
@@ -267,6 +274,7 @@
 {
        load_config();
        signal(SIGHUP, reload_config);
+       signal(SIGINT, exit_sigint);
 }
 
 void server::send_error(network::connection sock, const char* msg) const




Related Messages


Powered by MHonArc, Updated Wed Mar 19 03:21:04 2008