Commit fd8053d7 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Small code factorization

parent 4ab0edaf
...@@ -213,27 +213,21 @@ int module_Load( vlc_object_t *p_this, const char *psz_file, ...@@ -213,27 +213,21 @@ int module_Load( vlc_object_t *p_this, const char *psz_file,
return -1; return -1;
} }
#elif defined(HAVE_DL_DLOPEN) && defined(RTLD_NOW) #elif defined(HAVE_DL_DLOPEN)
# if defined (RTLD_NOLOAD) # if defined (RTLD_NOLOAD)
static pthread_once_t once = PTHREAD_ONCE_INIT; static pthread_once_t once = PTHREAD_ONCE_INIT;
pthread_once( &once, &load_libvlccore ); pthread_once( &once, &load_libvlccore );
# endif # endif
/* static is OK, we are called atomically */ # if defined (RTLD_NOW)
handle = dlopen( psz_file, RTLD_NOW ); const int flags = RTLD_NOW;
if( handle == NULL ) # elif defined (DL_LAZY)
{ const int flags = DL_LAZY;
msg_Warn( p_this, "cannot load module `%s' (%s)",
psz_file, dlerror() );
return -1;
}
#elif defined(HAVE_DL_DLOPEN)
# if defined(DL_LAZY)
handle = dlopen( psz_file, DL_LAZY );
# else # else
handle = dlopen( psz_file, 0 ); const int flags = 0;
# endif # endif
handle = dlopen( psz_file, RTLD_NOW );
if( handle == NULL ) if( handle == NULL )
{ {
msg_Warn( p_this, "cannot load module `%s' (%s)", msg_Warn( p_this, "cannot load module `%s' (%s)",
......
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