diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-11-01 12:33:22 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-11-05 09:22:02 -0500 |
commit | 6e7ff8cba0efaf803e3ef5b5aba4123633fe0658 (patch) | |
tree | 34d13bcfb483674e0ae52bd3fb60f371c20f0155 /src/app/config/config.c | |
parent | 7bb76b24cf755799b7950ef078ac5ccf4d6e3a8a (diff) | |
download | tor-6e7ff8cba0efaf803e3ef5b5aba4123633fe0658.tar.gz tor-6e7ff8cba0efaf803e3ef5b5aba4123633fe0658.zip |
Move the code that knows our tor version into a lowest-level lib
Diffstat (limited to 'src/app/config/config.c')
-rw-r--r-- | src/app/config/config.c | 41 |
1 files changed, 1 insertions, 40 deletions
diff --git a/src/app/config/config.c b/src/app/config/config.c index 6e7e131055..7b49387bcf 100644 --- a/src/app/config/config.c +++ b/src/app/config/config.c @@ -112,9 +112,9 @@ #include "lib/crypt_ops/crypto_rand.h" #include "lib/crypt_ops/crypto_util.h" #include "lib/encoding/confline.h" -#include "lib/log/git_revision.h" #include "lib/net/resolve.h" #include "lib/sandbox/sandbox.h" +#include "lib/version/torversion.h" #ifdef ENABLE_NSS #include "lib/crypt_ops/crypto_nss_mgt.h" @@ -972,42 +972,6 @@ set_options(or_options_t *new_val, char **msg) return 0; } -/** The version of this Tor process, as parsed. */ -static char *the_tor_version = NULL; -/** A shorter version of this Tor process's version, for export in our router - * descriptor. (Does not include the git version, if any.) */ -static char *the_short_tor_version = NULL; - -/** Return the current Tor version. */ -const char * -get_version(void) -{ - if (the_tor_version == NULL) { - if (strlen(tor_git_revision)) { - tor_asprintf(&the_tor_version, "%s (git-%s)", get_short_version(), - tor_git_revision); - } else { - the_tor_version = tor_strdup(get_short_version()); - } - } - return the_tor_version; -} - -/** Return the current Tor version, without any git tag. */ -const char * -get_short_version(void) -{ - - if (the_short_tor_version == NULL) { -#ifdef TOR_BUILD_TAG - tor_asprintf(&the_short_tor_version, "%s (%s)", VERSION, TOR_BUILD_TAG); -#else - the_short_tor_version = tor_strdup(VERSION); -#endif - } - return the_short_tor_version; -} - /** Release additional memory allocated in options */ STATIC void @@ -1067,9 +1031,6 @@ config_free_all(void) tor_free(torrc_defaults_fname); tor_free(global_dirfrontpagecontents); - tor_free(the_short_tor_version); - tor_free(the_tor_version); - cleanup_protocol_warning_severity_level(); have_parsed_cmdline = 0; |