math/grace port: "libXcursor.so.1.0" not found ?? [SOLVED]

Igor Robul igorr at speechpro.com
Thu Oct 27 01:27:02 PDT 2005


Igor Robul wrote:

> dlopen() _does not_ reset dlerror() state on sucess, it just returns 
> non NULL. So you must not check dlerror() for error condition, you 
> need check return result of dlopen(), and if it is NULL, then you need 
> use dlerror().
>
> So, code in grace:
>
>   dlopen("library name", MODE);
>   if (dlerror() != NULL) {
>      report_error();
>      exit(1);
>
Actual code in grace is:

 newkey.data = dlsym(handle, dl_function);
    if ((error = (char *) dlerror()) != NULL) {
        errmsg(error);
        dlclose(handle);
        return RETURN_FAILURE;
    }

But I think it is needed to be something like (I dont know if they need 
"error" variable later):

newkey.data = dlsym(handle, dl_function);
    if (  newkey.data == NULL) {
        errmsg(error=dlerror());
        dlclose(handle);
        return RETURN_FAILURE;
    }




More information about the freebsd-questions mailing list