aboutsummaryrefslogtreecommitdiff
path: root/src/or/main.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2009-06-30 10:13:51 -0400
committerNick Mathewson <nickm@torproject.org>2009-06-30 10:13:51 -0400
commit9f28cfe86af085e94b9b929041851dc8386231b2 (patch)
treed6eeb9feb098a1653e428bf39bac6340037bebd4 /src/or/main.c
parentf466f3d12c7480fcff8b3366991f7a44816d2e41 (diff)
parent1ace3799facd9cae6f16f64647fec2281333539f (diff)
downloadtor-9f28cfe86af085e94b9b929041851dc8386231b2.tar.gz
tor-9f28cfe86af085e94b9b929041851dc8386231b2.zip
Merge commit 'origin/maint-0.2.1'
Diffstat (limited to 'src/or/main.c')
-rw-r--r--src/or/main.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/or/main.c b/src/or/main.c
index c3dae2ad54..97957a5791 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -925,7 +925,7 @@ run_scheduled_events(time_t now)
time_to_downrate_stability = rep_hist_downrate_old_runs(now);
if (authdir_mode_tests_reachability(options)) {
if (time_to_save_stability < now) {
- if (time_to_save_stability && rep_hist_record_mtbf_data()<0) {
+ if (time_to_save_stability && rep_hist_record_mtbf_data(now, 1)<0) {
log_warn(LD_GENERAL, "Couldn't store mtbf data.");
}
#define SAVE_STABILITY_INTERVAL (30*60)
@@ -1970,14 +1970,15 @@ tor_cleanup(void)
/* 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->command == CMD_RUN_TOR) {
+ time_t now = time(NULL);
if (options->PidFile)
unlink(options->PidFile);
if (accounting_is_enabled(options))
- accounting_record_bandwidth_usage(time(NULL), get_or_state());
+ accounting_record_bandwidth_usage(now, get_or_state());
or_state_mark_dirty(get_or_state(), 0); /* force an immediate save. */
- or_state_save(time(NULL));
+ or_state_save(now);
if (authdir_mode_tests_reachability(options))
- rep_hist_record_mtbf_data();
+ rep_hist_record_mtbf_data(now, 0);
}
#ifdef USE_DMALLOC
dmalloc_log_stats();