[vlc-devel] commit: Small code factorization ( Rémi Denis-Courmont )

git version control git at videolan.org
Sat Jan 10 14:07:06 CET 2009


vlc | branch: master | Rémi Denis-Courmont <rdenis at simphalempin.com> | Sat Jan 10 14:51:51 2009 +0200| [fd8053d7bb737c566839597cc39fa236f35e4390] | committer: Rémi Denis-Courmont 

Small code factorization

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=fd8053d7bb737c566839597cc39fa236f35e4390
---

 src/modules/os.c |   24 +++++++++---------------
 1 files changed, 9 insertions(+), 15 deletions(-)

diff --git a/src/modules/os.c b/src/modules/os.c
index 38df5e7..997e780 100644
--- a/src/modules/os.c
+++ b/src/modules/os.c
@@ -213,27 +213,21 @@ int module_Load( vlc_object_t *p_this, const char *psz_file,
         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)",




More information about the vlc-devel mailing list