]> git.sesse.net Git - vlc/blobdiff - src/vlc.c
Cosmetic
[vlc] / src / vlc.c
index f1d34dcfd9e768c87693be396a73b13b1ba170b9..b7a340aad70b9149648c34b8601153f82b2f86cd 100644 (file)
--- a/src/vlc.c
+++ b/src/vlc.c
 
 #include "config.h"
 
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
 #include <vlc/vlc.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <locale.h>
+#ifdef __GLIBC__
+#include <dlfcn.h>
+#endif
 
 
 /* Explicit HACK */
@@ -59,10 +66,24 @@ static void *SigHandler (void *set);
 /*****************************************************************************
  * main: parse command line, start interface and spawn threads.
  *****************************************************************************/
-int main( int i_argc, char *ppsz_argv[] )
+int main( int i_argc, const char *ppsz_argv[] )
 {
     int i_ret;
 
+#   ifdef __GLIBC__
+    if (dlsym (RTLD_NEXT, "inet6_rth_add") && !dlsym (RTLD_NEXT, "qsort_r"))
+    {
+        /* Way too many Linux users have glibc 2.5-2.7 that keeps crashing
+         * inside its non-thread-safe dcgettext(). */
+        /* Hopefully glibc 2.8 will eventually work, not sure though */
+        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__
@@ -236,7 +257,8 @@ static void *SigHandler (void *data)
     for (;;)
     {
         int i_signal, state;
-        (void)sigwait (&fullset, &i_signal);
+        if( sigwait (&fullset, &i_signal) != 0 )
+            continue;
 
 #ifdef __APPLE__
         /* In Mac OS X up to 10.4.8 sigwait (among others) is not a pthread