Changeset abcabca628baf7989fde32b378c8d4783e6346df
- 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
| ra7dd995 |
rabcabca |
|
| 12 | 12 | |
|---|
| 13 | 13 | ./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 |
|---|
| 15 | 15 | |
|---|
| 16 | 16 | See `./configure --help' for more information. |
|---|
| r0edb872 |
rabcabca |
|
| 28 | 28 | #include <string.h> /* strerror() */ |
|---|
| 29 | 29 | #include <errno.h> /* ENOMEM */ |
|---|
| | 30 | #include <sys/types.h> /* open */ |
|---|
| | 31 | #include <sys/stat.h> |
|---|
| | 32 | #include <fcntl.h> |
|---|
| | 33 | #include <unistd.h> /* close */ |
|---|
| 30 | 34 | |
|---|
| 31 | 35 | #if defined(HAVE_DLFCN_H) /* Linux, BSD, Hurd */ |
|---|
| … | … | |
| 136 | 140 | char * TestPlugin ( plugin_id_t *p_plugin_id, char * psz_name ) |
|---|
| 137 | 141 | { |
|---|
| 138 | | int i_count, i_length; |
|---|
| | 142 | int i_count, i_length, i_fd; |
|---|
| 139 | 143 | char * psz_plugin; |
|---|
| 140 | 144 | char * psz_plugin_path[ ] = |
|---|
| … | … | |
| 164 | 168 | sprintf( psz_plugin, "%s/%s.so", psz_plugin_path[i_count], psz_name ); |
|---|
| 165 | 169 | |
|---|
| | 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 | |
|---|
| 166 | 179 | *p_plugin_id = dlopen( psz_plugin, RTLD_NOW | RTLD_GLOBAL ); |
|---|
| 167 | 180 | #endif |
|---|
| … | … | |
| 176 | 189 | return( psz_plugin ); |
|---|
| 177 | 190 | } |
|---|
| | 191 | |
|---|
| 178 | 192 | #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() ); |
|---|
| 183 | 194 | #endif |
|---|
| 184 | 195 | |
|---|