]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
if we're hibernating and we get a sigint, exit immediately.
authorRoger Dingledine <arma@torproject.org>
Thu, 10 Feb 2005 07:34:19 +0000 (07:34 +0000)
committerRoger Dingledine <arma@torproject.org>
Thu, 10 Feb 2005 07:34:19 +0000 (07:34 +0000)
closes bug 91.

svn:r3611

src/or/hibernate.c

index 0e7aa2eb93f2a497453ff6e67292ad1d71c363bd..ffd9138a68a7350a37a222f4f8b8774b5ecc522d 100644 (file)
@@ -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);
   }