1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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
parent 7af9f79560
commit 0af783bef4

View file

@ -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