aboutsummaryrefslogtreecommitdiff
path: root/src/init.cpp
diff options
context:
space:
mode:
authorPieter Wuille <[email protected]>2012-05-21 10:04:26 -0700
committerPieter Wuille <[email protected]>2012-05-21 10:04:26 -0700
commit63407fd6e29b29ee56c572d4c6789c3f305990fc (patch)
tree01b23cb06beddaf4fd8e0ba62a2cccef318b5b1f /src/init.cpp
parentMerge pull request #1329 from laanwj/2012_05_addrremovewhitespace (diff)
parentReopen debug.log on SIGHUP (diff)
downloaddiscoin-63407fd6e29b29ee56c572d4c6789c3f305990fc.tar.xz
discoin-63407fd6e29b29ee56c572d4c6789c3f305990fc.zip
Merge pull request #917 from mndrix/reopen-log-file
Reopen log file on SIGHUP
Diffstat (limited to 'src/init.cpp')
-rw-r--r--src/init.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/init.cpp b/src/init.cpp
index 4e193ffe3..325f8e0c5 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -82,6 +82,10 @@ void HandleSIGTERM(int)
fRequestShutdown = true;
}
+void HandleSIGHUP(int)
+{
+ fReopenDebugLog = true;
+}
@@ -291,7 +295,13 @@ bool AppInit2()
sa.sa_flags = 0;
sigaction(SIGTERM, &sa, NULL);
sigaction(SIGINT, &sa, NULL);
- sigaction(SIGHUP, &sa, NULL);
+
+ // Reopen debug.log on SIGHUP
+ struct sigaction sa_hup;
+ sa_hup.sa_handler = HandleSIGHUP;
+ sigemptyset(&sa_hup.sa_mask);
+ sa_hup.sa_flags = 0;
+ sigaction(SIGHUP, &sa_hup, NULL);
#endif
fTestNet = GetBoolArg("-testnet");