From 06d1189e948cea08ba8ddf302cc9439ba3abcb8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Wed, 31 Oct 2018 09:13:07 +0200 Subject: [PATCH] Remove unused and confusing variable The global version_string variable was never set. --- include/maxscale/config.h | 1 - server/core/config.cc | 10 ---------- server/core/service.cc | 10 +--------- 3 files changed, 1 insertion(+), 20 deletions(-) diff --git a/include/maxscale/config.h b/include/maxscale/config.h index 2d1849ac8..bea9dafc9 100644 --- a/include/maxscale/config.h +++ b/include/maxscale/config.h @@ -245,7 +245,6 @@ typedef struct bool config_check; /**< Only check config */ int n_threads; /**< Number of polling threads */ size_t thread_stack_size; /**< The stack size of each worker thread */ - char* version_string; /**< The version string of embedded db library */ char release_string[RELEASE_STR_LENGTH]; /**< The release name string of the system */ char sysname[SYSNAME_LEN]; /**< The OS name of the system */ uint8_t mac_sha1[SHA_DIGEST_LENGTH]; /**< The SHA1 digest of an interface MAC address diff --git a/server/core/config.cc b/server/core/config.cc index ecadd4bab..d17a8dcc0 100644 --- a/server/core/config.cc +++ b/server/core/config.cc @@ -234,7 +234,6 @@ void config_fix_param(const MXS_MODULE_PARAM* params, MXS_CONFIG_PARAMETER static const char* config_file = NULL; static MXS_CONFIG gateway; -char* version_string = NULL; static bool is_persisted_config = false; /**< True if a persisted configuration file is being parsed */ static CONFIG_CONTEXT config_context; @@ -2818,15 +2817,6 @@ void config_set_global_defaults() } } - if (version_string != NULL) - { - gateway.version_string = MXS_STRDUP_A(version_string); - } - else - { - gateway.version_string = NULL; - } - /* get release string */ if (!config_get_release_string(gateway.release_string)) { diff --git a/server/core/service.cc b/server/core/service.cc index 1abddcd60..911f1e38f 100644 --- a/server/core/service.cc +++ b/server/core/service.cc @@ -135,17 +135,9 @@ Service* service_alloc(const char* name, const char* router, MXS_CONFIG_PARAMETE static std::string get_version_string(MXS_CONFIG_PARAMETER* params) { - std::string version_string = config_get_string(params, CN_VERSION_STRING); - if (version_string.empty()) - { - if (config_get_global_options()->version_string) - { - version_string = config_get_global_options()->version_string; - } - } - else if (version_string[0] != '5') + if (!version_string.empty() && version_string[0] != '5') { /** * Add the 5.5.5- string to the start of the version string if the version