mirror of
https://github.com/monero-project/monero.git
synced 2024-12-23 20:19:34 +00:00
Add tools::on_startup, and warn about glibc 2.25 bug if found
https://sourceware.org/bugzilla/show_bug.cgi?id=21778
This commit is contained in:
parent
86e9de588c
commit
7130cf0c61
8 changed files with 23 additions and 6 deletions
|
@ -55,7 +55,7 @@ int main(int argc, char* argv[])
|
|||
uint64_t block_stop = 0;
|
||||
bool blocks_dat = false;
|
||||
|
||||
tools::sanitize_locale();
|
||||
tools::on_startup();
|
||||
|
||||
boost::filesystem::path default_data_path {tools::get_default_data_dir()};
|
||||
boost::filesystem::path default_testnet_data_path {default_data_path / "testnet"};
|
||||
|
|
|
@ -551,7 +551,7 @@ int main(int argc, char* argv[])
|
|||
std::string m_config_folder;
|
||||
std::string db_arg_str;
|
||||
|
||||
tools::sanitize_locale();
|
||||
tools::on_startup();
|
||||
|
||||
boost::filesystem::path default_data_path {tools::get_default_data_dir()};
|
||||
boost::filesystem::path default_testnet_data_path {default_data_path / "testnet"};
|
||||
|
|
|
@ -30,6 +30,10 @@
|
|||
|
||||
#include <cstdio>
|
||||
|
||||
#ifdef __GLIBC__
|
||||
#include <gnu/libc-version.h>
|
||||
#endif
|
||||
|
||||
#include "include_base_utils.h"
|
||||
#include "file_io_utils.h"
|
||||
using namespace epee;
|
||||
|
@ -536,6 +540,17 @@ std::string get_nix_version_display_string()
|
|||
}
|
||||
return false;
|
||||
}
|
||||
bool on_startup()
|
||||
{
|
||||
sanitize_locale();
|
||||
|
||||
#ifdef __GLIBC__
|
||||
const char *ver = gnu_get_libc_version();
|
||||
if (!strcmp(ver, "2.25"))
|
||||
MCLOG_RED(el::Level::Warning, "global", "Running with glibc " << ver << ", hangs may occur - change glibc version if possible");
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
void set_strict_default_file_permissions(bool strict)
|
||||
{
|
||||
#if defined(__MINGW32__) || defined(__MINGW__)
|
||||
|
|
|
@ -129,6 +129,8 @@ namespace tools
|
|||
|
||||
bool sanitize_locale();
|
||||
|
||||
bool on_startup();
|
||||
|
||||
/*! \brief Defines a signal handler for win32 and *nix
|
||||
*/
|
||||
class signal_handler
|
||||
|
|
|
@ -61,7 +61,7 @@ int main(int argc, char const * argv[])
|
|||
|
||||
// TODO parse the debug options like set log level right here at start
|
||||
|
||||
tools::sanitize_locale();
|
||||
tools::on_startup();
|
||||
|
||||
epee::string_tools::set_module_name_and_folder(argv[0]);
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ int main(int argc, char* argv[])
|
|||
uint32_t log_level = 0;
|
||||
std::string input;
|
||||
|
||||
tools::sanitize_locale();
|
||||
tools::on_startup();
|
||||
|
||||
boost::filesystem::path output_file_path;
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@ int main(int argc, char* argv[])
|
|||
{
|
||||
size_logger sl;
|
||||
|
||||
tools::sanitize_locale();
|
||||
tools::on_startup();
|
||||
|
||||
mlog_configure("", true);
|
||||
|
||||
|
|
|
@ -91,7 +91,7 @@ namespace wallet_args
|
|||
|
||||
|
||||
std::string lang = i18n_get_language();
|
||||
tools::sanitize_locale();
|
||||
tools::on_startup();
|
||||
tools::set_strict_default_file_permissions(true);
|
||||
|
||||
epee::string_tools::set_module_name_and_folder(argv[0]);
|
||||
|
|
Loading…
Reference in a new issue