aboutsummaryrefslogtreecommitdiff
path: root/init.cpp
diff options
context:
space:
mode:
authortcatm <[email protected]>2011-03-23 18:27:30 +0100
committertcatm <[email protected]>2011-03-23 18:27:30 +0100
commitc3f140033c531e9c5eae920c16fe2ecc80faa1a2 (patch)
treeb4bae2d1ad98c706cd590f3bf0fc27538c2a694f /init.cpp
parentdaemon-mode: add sleep() loop to prevent defunct child process, call setsid()... (diff)
downloaddiscoin-c3f140033c531e9c5eae920c16fe2ecc80faa1a2.tar.xz
discoin-c3f140033c531e9c5eae920c16fe2ecc80faa1a2.zip
catch SIGINT, SIGHUP and SIGSEGV and shutdown cleanly
Diffstat (limited to 'init.cpp')
-rw-r--r--init.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/init.cpp b/init.cpp
index c0b03c877..071d254eb 100644
--- a/init.cpp
+++ b/init.cpp
@@ -120,6 +120,9 @@ bool AppInit2(int argc, char* argv[])
sigemptyset(&sa.sa_mask);
sa.sa_flags = 0;
sigaction(SIGTERM, &sa, NULL);
+ sigaction(SIGINT, &sa, NULL);
+ sigaction(SIGHUP, &sa, NULL);
+ sigaction(SIGSEGV, &sa, NULL);
#endif
//