summaryrefslogtreecommitdiff
path: root/src/or/hibernate.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2005-01-14 17:49:25 +0000
committerRoger Dingledine <arma@torproject.org>2005-01-14 17:49:25 +0000
commitc6771e5ce4a6b97cd3ca6be445bae6fbf8f2cb8c (patch)
tree4b2aa30fe28aee1d1e28ab3ac865f99805f14a41 /src/or/hibernate.c
parentdcf8b18215d0565d821ca31e784a501f88aab9d5 (diff)
downloadtor-c6771e5ce4a6b97cd3ca6be445bae6fbf8f2cb8c.tar.gz
tor-c6771e5ce4a6b97cd3ca6be445bae6fbf8f2cb8c.zip
reset published uptime when you wake up from hibernation,
since if you hibernate daily a published uptime of >1day will be misleading. svn:r3356
Diffstat (limited to 'src/or/hibernate.c')
-rw-r--r--src/or/hibernate.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/or/hibernate.c b/src/or/hibernate.c
index fdb72ee56c..9a2031aa86 100644
--- a/src/or/hibernate.c
+++ b/src/or/hibernate.c
@@ -31,6 +31,8 @@ hibernating, phase 2:
#define SHUTDOWN_WAIT_LENGTH 30 /* seconds */
+extern long stats_n_seconds_working; /* published uptime */
+
static int hibernate_state = HIBERNATE_STATE_LIVE;
/** If are hibernating, when do we plan to wake up? Set to 0 if we
* aren't hibernating. */
@@ -693,6 +695,7 @@ hibernate_end(int new_state) {
hibernate_state = new_state;
hibernate_end_time = 0; /* no longer hibernating */
+ stats_n_seconds_working = 0; /* reset published uptime */
}
/** A wrapper around hibernate_begin, for when we get SIGINT. */