aboutsummaryrefslogtreecommitdiff
path: root/src/or/main.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2006-03-12 20:51:02 +0000
committerRoger Dingledine <arma@torproject.org>2006-03-12 20:51:02 +0000
commitef447507ffa32d5857f1ea6583ba5c39e3b96ed0 (patch)
treeded255530e25db3581afb5d3e3578c4735772144 /src/or/main.c
parenta98b25137c5ee2399b4350ca1bb3e1c39fc5aea6 (diff)
downloadtor-ef447507ffa32d5857f1ea6583ba5c39e3b96ed0.tar
tor-ef447507ffa32d5857f1ea6583ba5c39e3b96ed0.tar.gz
a better clean-up
svn:r6139
Diffstat (limited to 'src/or/main.c')
-rw-r--r--src/or/main.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/or/main.c b/src/or/main.c
index aee914acc..84c5c83b5 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -1539,12 +1539,13 @@ tor_cleanup(void)
or_options_t *options = get_options();
/* Remove our pid file. We don't care if there was an error when we
* unlink, nothing we could do about it anyways. */
- if (options->PidFile && options->command == CMD_RUN_TOR)
- unlink(options->PidFile);
- if (accounting_is_enabled(options))
- accounting_record_bandwidth_usage(time(NULL));
- if (options->command == CMD_RUN_TOR)
+ if (options->command == CMD_RUN_TOR) {
+ if (options->PidFile)
+ unlink(options->PidFile);
+ if (accounting_is_enabled(options))
+ accounting_record_bandwidth_usage(time(NULL));
or_state_save();
+ }
tor_free_all(0); /* move tor_free_all back into the ifdef below later. XXX*/
crypto_global_cleanup();
#ifdef USE_DMALLOC