Commit 360d2a9b authored by Sam Hocevar's avatar Sam Hocevar

* ./src/misc/modules_plugin.h.in: when opening the KDE plugin, we first

    dlopen(libstdc++) to avoid dlopen(kde_plugin) from crashing. Call me evil.
parent ec473b50
......@@ -2,7 +2,7 @@
* modules_plugin.h : Plugin management functions used by the core application.
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: modules_plugin.h.in,v 1.8 2002/12/06 10:10:39 sam Exp $
* $Id: modules_plugin.h.in,v 1.9 2003/02/10 20:11:14 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -42,16 +42,31 @@ static int module_load( const MYCHAR * psz_filename, module_handle_t * handle )
return( *handle == NULL );
#elif defined(RTLD_NOW)
/* static is OK, we are called atomically */
static vlc_bool_t b_kde = VLC_FALSE;
# if defined(SYS_LINUX)
/* We should NOT open modules with RTLD_GLOBAL, or we are going to get
* namespace collisions when two modules have common public symbols,
* but ALSA is being a pest here. */
if( strstr( psz_filename, "alsa" ) )
/* XXX HACK #1 - we should NOT open modules with RTLD_GLOBAL, or we
* are going to get namespace collisions when two modules have common
* public symbols, but ALSA is being a pest here. */
if( strstr( psz_filename, "alsa_plugin" ) )
{
*handle = dlopen( psz_filename, RTLD_NOW | RTLD_GLOBAL );
return( *handle == NULL );
}
# endif
/* XXX HACK #2 - the ugly KDE workaround. It seems that libkdewhatever
* causes dlopen() to segfault if libstdc++ is not loaded in the caller,
* so we just load libstdc++. Bwahahaha! ph34r! -- Sam. */
if( !b_kde && !strstr( psz_filename, "kde" ) )
{
dlopen( "libstdc++.so.6", RTLD_NOW )
|| dlopen( "libstdc++.so.5", RTLD_NOW )
|| dlopen( "libstdc++.so.4", RTLD_NOW )
|| dlopen( "libstdc++.so.3", RTLD_NOW );
b_kde = VLC_TRUE;
}
*handle = dlopen( psz_filename, RTLD_NOW );
return( *handle == NULL );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment