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:
moneromooo-monero 2017-10-03 10:12:57 +01:00
parent 86e9de588c
commit 7130cf0c61
No known key found for this signature in database
GPG key ID: 686F07454D6CEFC3
8 changed files with 23 additions and 6 deletions

View file

@ -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__)

View file

@ -129,6 +129,8 @@ namespace tools
bool sanitize_locale();
bool on_startup();
/*! \brief Defines a signal handler for win32 and *nix
*/
class signal_handler