diff options
author | Nick Mathewson <nickm@torproject.org> | 2007-10-17 16:55:44 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2007-10-17 16:55:44 +0000 |
commit | f988f93b1a54ccbfabbf464514c526033f48e15c (patch) | |
tree | d8b7ecfa712171ad29e960c410d3fbd1017c193a /src/or/rephist.c | |
parent | 4088a90d5580612bd3a347be3ddddf3891b60469 (diff) | |
download | tor-f988f93b1a54ccbfabbf464514c526033f48e15c.tar.gz tor-f988f93b1a54ccbfabbf464514c526033f48e15c.zip |
r15877@catbus: nickm | 2007-10-17 12:54:56 -0400
Make unverified-consensus get removed when it is accepted or rejected. Make a new get_datadir_fname*() set of functions to eliminate the common code of "get the options, get the datadir, append some stuff".
svn:r12000
Diffstat (limited to 'src/or/rephist.c')
-rw-r--r-- | src/or/rephist.c | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/src/or/rephist.c b/src/or/rephist.c index 8f3c5b8038..19377369d8 100644 --- a/src/or/rephist.c +++ b/src/or/rephist.c @@ -595,18 +595,6 @@ rep_history_clean(time_t before) } } -/** Return a newly allocated string holding the filename in which we store - * MTBF information. */ -static char * -get_mtbf_filename(void) -{ - const char *datadir = get_options()->DataDirectory; - size_t len = strlen(datadir)+32; - char *fn = tor_malloc(len); - tor_snprintf(fn, len, "%s"PATH_SEPARATOR"router-stability", datadir); - return fn; -} - /** Write MTBF data to disk. Returns 0 on success, negative on failure. */ int rep_hist_record_mtbf_data(void) @@ -621,7 +609,7 @@ rep_hist_record_mtbf_data(void) FILE *f; { - char *filename = get_mtbf_filename(); + char *filename = get_datadir_fname("router-stability"); f = start_writing_to_stdio_file(filename, OPEN_FLAGS_REPLACE|O_TEXT, 0600, &open_file); tor_free(filename); @@ -725,7 +713,7 @@ rep_hist_load_mtbf_data(time_t now) long format = -1; { - char *filename = get_mtbf_filename(); + char *filename = get_datadir_fname("router-stability"); char *d = read_file_to_str(filename, RFTS_IGNORE_MISSING, NULL); tor_free(filename); if (!d) |