mirror of
https://github.com/radareorg/r2pipe-go.git
synced 2026-11-07 06:25:58 -10:00
Simplify the errors in native.go and make them more descriptive
This commit is contained in:
1 parent
2e9d80edb3
commit
f87fd79670
1 file changed
+3
-2
@@ -73,14 +73,15 @@ func dlOpen(path string) (*DL, error) {
|
||||
}
|
||||
|
||||
func dlSym(dl *DL, name string) (unsafe.Pointer, error) {
|
||||
err := fmt.Errorf("Failed to load '%s' from '%s'", name, dl.name)
|
||||
cname := C.CString(name)
|
||||
if cname == nil {
|
||||
return nil, errors.New("Fail")
|
||||
return nil, errors.New(err)
|
||||
}
|
||||
handle := C.dlsym(dl.handle, cname)
|
||||
C.free(unsafe.Pointer(cname))
|
||||
if handle == nil {
|
||||
return nil, errors.New("Fail")
|
||||
return nil, errors.New(err)
|
||||
}
|
||||
return handle, nil
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user