From 7c85a638b054f115cbb3c00d45e32cbf6db2a56c Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Sat, 6 Jul 2013 14:58:34 -0400 Subject: Added creation and periodic update of a file called "status" in the home directory that contains peer link status. Useful for debugging and statistics. Send it SIGHUP to force an update now. Otherwise it updates every 120 seconds. --- main.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'main.cpp') diff --git a/main.cpp b/main.cpp index 44f93522..13379ad6 100644 --- a/main.cpp +++ b/main.cpp @@ -70,12 +70,18 @@ static void sighandlerQuit(int sig) static void sighandlerUsr(int sig) { } +static void sighandlerHup(int sig) +{ + Node *n = node; + if (n) + n->updateStatusNow(); +} #endif int main(int argc,char **argv) { #ifndef _WIN32 - signal(SIGHUP,SIG_IGN); + signal(SIGHUP,&sighandlerHup); signal(SIGPIPE,SIG_IGN); signal(SIGUSR1,&sighandlerUsr); signal(SIGUSR2,&sighandlerUsr); -- cgit v1.2.3