diff options
author | Riccardo Spagni <ric@spagni.net> | 2017-10-15 18:32:09 +0200 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2017-10-15 18:32:09 +0200 |
commit | c45f3ac4d91bdd65b3c4b1974f93a4a9f81c67e7 (patch) | |
tree | a64cae31309766f3d5d6897e8a56b506361822b7 /src/common | |
parent | Merge pull request #2567 (diff) | |
parent | Add tools::on_startup, and warn about glibc 2.25 bug if found (diff) | |
download | monero-c45f3ac4d91bdd65b3c4b1974f93a4a9f81c67e7.tar.xz |
Merge pull request #2568
7130cf0c Add tools::on_startup, and warn about glibc 2.25 bug if found (moneromooo-monero)
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/util.cpp | 15 | ||||
-rw-r--r-- | src/common/util.h | 2 |
2 files changed, 17 insertions, 0 deletions
diff --git a/src/common/util.cpp b/src/common/util.cpp index 74a6babf1..30746f680 100644 --- a/src/common/util.cpp +++ b/src/common/util.cpp @@ -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__) diff --git a/src/common/util.h b/src/common/util.h index 48bdbbc28..2e4d6e917 100644 --- a/src/common/util.h +++ b/src/common/util.h @@ -129,6 +129,8 @@ namespace tools bool sanitize_locale(); + bool on_startup(); + /*! \brief Defines a signal handler for win32 and *nix */ class signal_handler |