Changeset abcabca628baf7989fde32b378c8d4783e6346df

Show
Ignore:
Timestamp:
20/12/00 17:39:16 (8 years ago)
Author:
Sam Hocevar <sam@videolan.org>
git-committer:
Sam Hocevar <sam@videolan.org> 977330356 +0000
git-parent:

[50118171a93a426f2f553369aa65bbc42101d8b8]

git-author:
Sam Hocevar <sam@videolan.org> 977330356 +0000
Message:

. now we only try to open plugins which are existing files

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • INSTALL

    ra7dd995 rabcabca  
    1212 
    1313   ./configure --prefix=/usr --enable-mmx --enable-gnome --enable-fb \ 
    14            --enable-glide --enable-ggi --enable-mga --enable-esd --enable-alsa 
     14           --enable-glide --enable-ggi --enable-sdl --enable-esd --enable-alsa 
    1515 
    1616See `./configure --help' for more information. 
  • src/misc/plugins.c

    r0edb872 rabcabca  
    2828#include <string.h>                                            /* strerror() */ 
    2929#include <errno.h>                                                 /* ENOMEM */ 
     30#include <sys/types.h>                                               /* open */ 
     31#include <sys/stat.h> 
     32#include <fcntl.h> 
     33#include <unistd.h>                                                 /* close */ 
    3034 
    3135#if defined(HAVE_DLFCN_H)                                /* Linux, BSD, Hurd */ 
     
    136140char * TestPlugin ( plugin_id_t *p_plugin_id, char * psz_name ) 
    137141{ 
    138     int i_count, i_length
     142    int i_count, i_length, i_fd
    139143    char * psz_plugin; 
    140144    char * psz_plugin_path[ ] = 
     
    164168        sprintf( psz_plugin, "%s/%s.so", psz_plugin_path[i_count], psz_name ); 
    165169 
     170        /* Try to open the plugin before dlopen()ing it. */ 
     171        i_fd = open( psz_plugin, O_RDONLY ); 
     172        if( i_fd == -1 ) 
     173        { 
     174            free( psz_plugin ); 
     175            continue; 
     176        } 
     177        close( i_fd ); 
     178         
    166179        *p_plugin_id = dlopen( psz_plugin, RTLD_NOW | RTLD_GLOBAL ); 
    167180#endif 
     
    176189            return( psz_plugin ); 
    177190        } 
     191 
    178192#ifndef SYS_BEOS 
    179         else 
    180         { 
    181             intf_WarnMsg( 1, "dlerror: %s\n", dlerror() ); 
    182         } 
     193        intf_WarnMsg( 1, "Plugin %s failed: %s\n", psz_plugin, dlerror() ); 
    183194#endif 
    184195