diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2017-10-03 10:12:57 +0100 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2017-10-14 09:12:28 +0100 |
commit | 7130cf0c61e259ee6d8479cd804e9284cf6859f6 (patch) | |
tree | f1b11af35294d103d79cf0870535a147bd775683 /src/common/util.cpp | |
parent | Merge pull request #2548 (diff) | |
download | monero-7130cf0c61e259ee6d8479cd804e9284cf6859f6.tar.xz |
Add tools::on_startup, and warn about glibc 2.25 bug if found
https://sourceware.org/bugzilla/show_bug.cgi?id=21778
Diffstat (limited to '')
-rw-r--r-- | src/common/util.cpp | 15 |
1 files changed, 15 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__) |