]> git.sesse.net Git - vlc/commitdiff
Horrific kludge to prevent awfully crappy glibc from crashing VLC all the time.
authorRémi Denis-Courmont <rem@videolan.org>
Tue, 27 Nov 2007 20:11:16 +0000 (20:11 +0000)
committerRémi Denis-Courmont <rem@videolan.org>
Tue, 27 Nov 2007 20:11:16 +0000 (20:11 +0000)
src/vlc.c

index 9d1cee46b98e6287e9f92baf9ec67bb73c9aad0b..828ea264eade0f0a157a763c7542501eea92ce98 100644 (file)
--- a/src/vlc.c
+++ b/src/vlc.c
@@ -31,6 +31,9 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <locale.h>
+#ifdef __GLIBC__
+#include <dlfcn.h>
+#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__