diff options
author | s_nakamoto <s_nakamoto@1a98c847-1fd6-4fd8-948a-caf3550aa51b> | 2010-09-08 19:24:32 +0000 |
---|---|---|
committer | s_nakamoto <s_nakamoto@1a98c847-1fd6-4fd8-948a-caf3550aa51b> | 2010-09-08 19:24:32 +0000 |
commit | 3f647537790e02e892701f4bb2586ccd964c2631 (patch) | |
tree | bdbaf24dfcf13214803ba6416871b91b2b7a39ef /init.cpp | |
parent | f1e1fb4bdef878c8fc1564fa418d44e7541a7e83 (diff) |
Gavin Andresen: clean shutdown on SIGTERM
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@149 1a98c847-1fd6-4fd8-948a-caf3550aa51b
Diffstat (limited to 'init.cpp')
-rw-r--r-- | init.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -10,7 +10,6 @@ - ////////////////////////////////////////////////////////////////////////////// // // Shutdown @@ -57,6 +56,11 @@ void Shutdown(void* parg) } } +void HandleSIGTERM(int) +{ + fRequestShutdown = true; +} + @@ -130,6 +134,14 @@ bool AppInit2(int argc, char* argv[]) #ifndef __WXMSW__ umask(077); #endif +#ifndef __WXMSW__ + // Clean shutdown on SIGTERM + struct sigaction sa; + sa.sa_handler = HandleSIGTERM; + sigemptyset(&sa.sa_mask); + sa.sa_flags = 0; + sigaction(SIGTERM, &sa, NULL); +#endif // // Parameters |