From fb033327d51610e3069033089d78a3343232255a Mon Sep 17 00:00:00 2001 From: =?utf8?q?R=C3=A9mi=20Denis-Courmont?= Date: Tue, 27 Nov 2007 20:11:16 +0000 Subject: [PATCH] Horrific kludge to prevent awfully crappy glibc from crashing VLC all the time. --- src/vlc.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/vlc.c b/src/vlc.c index 9d1cee46b9..828ea264ea 100644 --- a/src/vlc.c +++ b/src/vlc.c @@ -31,6 +31,9 @@ #include #include #include +#ifdef __GLIBC__ +#include +#endif /* Explicit HACK */ @@ -63,6 +66,19 @@ int main( int i_argc, const char *ppsz_argv[] ) { int i_ret; +# ifdef __GLIBC__ + if (dlsym (RTLD_NEXT, "sync_file_range")) + { + /* Way too many Linux users have glibc 2.6 that keeps crashing + * inside its non-thread-safe dcgettext(). */ + fprintf (stderr, +"***************************************************\n" +"*** glibc version with broken libintl detected. ***\n" +"*** Messages localization will be disabled. ***\n" +"***************************************************\n"); + setenv ("LC_MESSAGES", "C", 1); + } +# endif setlocale (LC_ALL, ""); #ifndef __APPLE__ -- 2.39.2