[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] if we"re hibernating and we get a sigint, exit immediately.



Update of /home2/or/cvsroot/tor/src/or
In directory moria.mit.edu:/home2/arma/work/onion/cvs/tor/src/or

Modified Files:
	hibernate.c 
Log Message:
if we're hibernating and we get a sigint, exit immediately.
closes bug 91.


Index: hibernate.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/hibernate.c,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -d -r1.44 -r1.45
--- hibernate.c	2 Feb 2005 06:28:45 -0000	1.44
+++ hibernate.c	10 Feb 2005 07:34:19 -0000	1.45
@@ -657,9 +657,11 @@
 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);
   }