#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 */
/*****************************************************************************
* 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__
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