lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

> Additionally, the check should not be `f == NULL`. From man page:
> > Since the value of the symbol could actually be NULL (so that a NULL return from dlsym()
> > need not indicate an error), the correct way to test for an error is to call dlerror() to clear any
> > old error conditions, then call dlsym(), and then call dlerror() again, saving its return value into
> > a variable, and check whether this saved value is not NULL.

In our case, the symbol could not be NULL (as it must point to a valid
function), so a NULL return must be an error (maybe of a different sort,
but an error nonetheless).

-- Roberto