Check the return value of dlopen().

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3334 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ttate 2003-01-12 13:11:32 +00:00
Родитель 7af9f79560
Коммит 0af783bef4
1 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -65,7 +65,7 @@ rb_dlhandle_initialize(int argc, VALUE argv[], VALUE self)
ptr = dlopen(clib, cflag);
#if defined(HAVE_DLERROR)
if( (err = dlerror()) ){
if( !ptr && (err = dlerror()) ){
rb_raise(rb_eRuntimeError, err);
}
#else
@ -168,7 +168,7 @@ rb_dlhandle_sym(int argc, VALUE argv[], VALUE self)
func = dlsym(handle, name);
#if defined(HAVE_DLERROR)
if( (err = dlerror()) && (!func) )
if( !func && (err = dlerror()) )
#else
if( !func )
#endif
@ -183,7 +183,7 @@ rb_dlhandle_sym(int argc, VALUE argv[], VALUE self)
func = dlsym(handle, name_a);
dlfree(name_a);
#if defined(HAVE_DLERROR)
if( (err = dlerror()) && (!func) )
if( !func && (err = dlerror()) )
#else
if( !func )
#endif