From f988f93b1a54ccbfabbf464514c526033f48e15c Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Wed, 17 Oct 2007 16:55:44 +0000 Subject: 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 --- src/or/rephist.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'src/or/rephist.c') 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) -- cgit v1.2.3-54-g00ecf