summaryrefslogtreecommitdiff
path: root/src/or/hibernate.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2005-02-10 07:34:19 +0000
committerRoger Dingledine <arma@torproject.org>2005-02-10 07:34:19 +0000
commit33569e40d7fc164b00891a120dec9fa1c6d9e58f (patch)
treecdb36662fa8cec2758c11276f30fb2003fc14f6b /src/or/hibernate.c
parent236aa86ae72d82d5294f591b75133182b7a1d4d4 (diff)
downloadtor-33569e40d7fc164b00891a120dec9fa1c6d9e58f.tar.gz
tor-33569e40d7fc164b00891a120dec9fa1c6d9e58f.zip
if we're hibernating and we get a sigint, exit immediately.
closes bug 91. svn:r3611
Diffstat (limited to 'src/or/hibernate.c')
-rw-r--r--src/or/hibernate.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/or/hibernate.c b/src/or/hibernate.c
index 0e7aa2eb93..ffd9138a68 100644
--- a/src/or/hibernate.c
+++ b/src/or/hibernate.c
@@ -657,9 +657,11 @@ static int hibernate_soft_limit_reached(void)
static void hibernate_begin(int new_state, time_t now) {
connection_t *conn;
- if (hibernate_state == HIBERNATE_STATE_EXITING) {
- /* we've been called twice now. close immediately. */
- log(LOG_NOTICE,"Second sigint received; exiting now.");
+ if (new_state == HIBERNATE_STATE_EXITING &&
+ hibernate_state != HIBERNATE_STATE_LIVE) {
+ log(LOG_NOTICE,"Sigint received %s; exiting now.",
+ hibernate_state == HIBERNATE_STATE_EXITING ?
+ "a second time" : "while hibernating");
tor_cleanup();
exit(0);
}