[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: Missing errors with async functions

> ldap_search() and ldap_result() returns -1 in case of error, but how do
> I know what exactly the error was? Internally it uses ld->ld_errno, but
> LDAP struct isn't accessible externally. I didn't see any function
> either for accessing it, except for ldap_perror() but I don't want to
> print it to stderr.

    int   rc;
    LDAP *ld;

    // provide a valid ld and an error condition; then

    ldap_get_option(ld, LDAP_OPT_ERROR_NUMBER, &rc);

You may retrieve a lot of other info the same way.


Pierangelo Masarati