CFT: devel/directfb update to 1.1.1

Anatoly Borodin anatoly.borodin at gmail.com
Wed Apr 16 15:22:58 UTC 2008


Hi!


On Wed, Apr 16, 2008 at 4:55 PM, Ganael LAPLANCHE
<ganael.laplanche at martymac.com> wrote:
>  It produces the same error as previously reported : "No system found!". Very
>  strange, but applying those two patches allows the libs to be found and mplayer
>  to (nearly) start :

It's not as simple as it may seem...

These are the comments from the DirectFB repository.

commit ac94b2ebc28cf6cc28c8c8357e48b9869c1501d9
Author: Claudio Ciccani <klan at directfb.org>
Date:   Tue Oct 3 12:19:15 2006 +0000

    Use readdir_r() instead of readdir().

diff --git a/lib/direct/interface.c b/lib/direct/interface.c
index 312f4fb..9af7f94 100644
--- a/lib/direct/interface.c
+++ b/lib/direct/interface.c
@@ -101,7 +101,8 @@ DirectGetInterface( DirectInterfaceFuncs     **funcs,
      int                         len;
      DIR                        *dir;
      char                       *interface_dir;
-     struct dirent              *entry;
+     struct dirent              *entry = NULL;
+     struct dirent               tmp;
 #endif

      DirectLink *link;
@@ -157,7 +158,7 @@ DirectGetInterface( DirectInterfaceFuncs     **funcs,
      /*
       * Iterate directory.
       */
-     while ( (entry = readdir(dir) ) != NULL ) {
+     while (readdir_r( dir, &tmp, &entry ) == 0 && entry) {
           void *handle = NULL;
           char  buf[4096];

@@ -191,12 +192,7 @@ DirectGetInterface( DirectInterfaceFuncs     **funcs,
           /*
            * Open it and check.
            */
-#ifdef RTLD_GLOBAL
-          handle = dlopen( buf, RTLD_NOW /*| RTLD_GLOBAL*/ );
-#else
-          /* RTLD_GLOBAL is missing on OpenBSD*/
           handle = dlopen( buf, RTLD_NOW );
-#endif
           if (handle) {
                DirectInterfaceImplementation *impl =
(DirectInterfaceImplementation*) implementations;

commit 63607c8aa5ae4bedec39cfa0660f80587103d610
Author: Claudio Ciccani <klan at directfb.org>
Date:   Fri Oct 6 12:09:53 2006 +0000

    readdir_r() instead of readdir().

diff --git a/lib/direct/modules.c b/lib/direct/modules.c
index 01741b2..56099e3 100644
--- a/lib/direct/modules.c
+++ b/lib/direct/modules.c
@@ -142,7 +142,8 @@ direct_modules_explore_directory( DirectModuleDir
*directory )
 #ifdef DYNAMIC_LINKING
      int            dir_len;
      DIR           *dir;
-     struct dirent *entry;
+     struct dirent *entry = NULL;
+     struct dirent  tmp;
      int            count = 0;

      D_ASSERT( directory != NULL );
@@ -156,7 +157,7 @@ direct_modules_explore_directory( DirectModuleDir
*directory )
           return 0;
      }

-     while ((entry = readdir( dir )) != NULL) {
+     while (readdir_r( dir, &tmp, &entry ) == 0 && entry) {
           void              *handle;
           DirectModuleEntry *module;
           int                entry_len = strlen(entry->d_name);


-- 
Mit freundlichen Grüßen,
Anatoly Borodin
business: anatoly.borodin at gmail.com
privat: fractalizator at gmail.com


More information about the freebsd-ports mailing list