return -1;
}
-#elif defined(HAVE_DL_DLOPEN) && defined(RTLD_NOW)
+#elif defined(HAVE_DL_DLOPEN)
# if defined (RTLD_NOLOAD)
static pthread_once_t once = PTHREAD_ONCE_INIT;
pthread_once( &once, &load_libvlccore );
# endif
- /* static is OK, we are called atomically */
- handle = dlopen( psz_file, RTLD_NOW );
- if( handle == NULL )
- {
- msg_Warn( p_this, "cannot load module `%s' (%s)",
- psz_file, dlerror() );
- return -1;
- }
+# if defined (RTLD_NOW)
+ const int flags = RTLD_NOW;
+# elif defined (DL_LAZY)
+ const int flags = DL_LAZY;
+# else
+ const int flags = 0;
+# endif
-#elif defined(HAVE_DL_DLOPEN)
-# if defined(DL_LAZY)
- handle = dlopen( psz_file, DL_LAZY );
-# else
- handle = dlopen( psz_file, 0 );
-# endif
+ handle = dlopen( psz_file, RTLD_NOW );
if( handle == NULL )
{
msg_Warn( p_this, "cannot load module `%s' (%s)",