X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fvlc.c;h=11a7c632d29826d61d3e58cc65f3d640edefa93b;hb=49f1ab3203cb70868fd28a498bfa1ce3376c6335;hp=c884610acb7e4070184e6767f06b29af4b4dab16;hpb=d10ea719a3b2a41c372e4557d5cd0c6b863617a8;p=vlc diff --git a/src/vlc.c b/src/vlc.c index c884610acb..11a7c632d2 100644 --- a/src/vlc.c +++ b/src/vlc.c @@ -31,6 +31,9 @@ #include #include #include +#ifdef __GLIBC__ +#include +#endif /* Explicit HACK */ @@ -59,10 +62,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__ @@ -78,12 +95,6 @@ int main( int i_argc, char *ppsz_argv[] ) /* 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) @@ -242,7 +253,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