#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__
/* Disable the ugly Gnome crash dialog so that we properly segfault */
putenv( (char *)"GNOME_DISABLE_CRASH_DIALOG=1" );
# endif
-
- /* If the user isn't using VLC_VERBOSE, set it to 0 by default */
- if( getenv( "VLC_VERBOSE" ) == NULL )
- {
- putenv( (char *)"VLC_VERBOSE=0" );
- }
#endif
#if defined (HAVE_GETEUID) && !defined (SYS_BEOS)
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