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:
parent
7af9f79560
commit
0af783bef4
1 changed files with 3 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue