if we're hibernating and we get a sigint, exit immediately.

closes bug 91.


svn:r3611
This commit is contained in:
Roger Dingledine 2005-02-10 07:34:19 +00:00
parent 236aa86ae7
commit 33569e40d7

View File

@ -657,9 +657,11 @@ static int hibernate_soft_limit_reached(void)
static void hibernate_begin(int new_state, time_t now) { static void hibernate_begin(int new_state, time_t now) {
connection_t *conn; connection_t *conn;
if (hibernate_state == HIBERNATE_STATE_EXITING) { if (new_state == HIBERNATE_STATE_EXITING &&
/* we've been called twice now. close immediately. */ hibernate_state != HIBERNATE_STATE_LIVE) {
log(LOG_NOTICE,"Second sigint received; exiting now."); log(LOG_NOTICE,"Sigint received %s; exiting now.",
hibernate_state == HIBERNATE_STATE_EXITING ?
"a second time" : "while hibernating");
tor_cleanup(); tor_cleanup();
exit(0); exit(0);
} }