mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-02-17 14:00:30 +08:00
Add error number to tool_perror() output
Don't hardcode function name.
This commit is contained in:
parent
4537065ffc
commit
be14ac9fed
@ -189,14 +189,15 @@ NULL
|
||||
}
|
||||
|
||||
void tool_perror(
|
||||
char *func,
|
||||
int err,
|
||||
char *extra,
|
||||
char *matched,
|
||||
char *info,
|
||||
char **refs )
|
||||
{
|
||||
fprintf( stderr, "ldap_bind: %s%s\n",
|
||||
ldap_err2string( err ), extra ? extra : "" );
|
||||
fprintf( stderr, "%s: %s (%d)%s\n",
|
||||
func, ldap_err2string( err ), err, extra ? extra : "" );
|
||||
|
||||
if ( matched && *matched ) {
|
||||
fprintf( stderr, _("\tmatched DN: %s\n"), matched );
|
||||
@ -1023,7 +1024,7 @@ tool_bind( LDAP *ld )
|
||||
|| ( info && info[ 0 ] )
|
||||
|| refs )
|
||||
{
|
||||
tool_perror( err, msgbuf, matched, info, refs );
|
||||
tool_perror( "ldap_bind", err, msgbuf, matched, info, refs );
|
||||
|
||||
if( matched ) ber_memfree( matched );
|
||||
if( info ) ber_memfree( info );
|
||||
|
@ -83,6 +83,7 @@ void tool_destroy LDAP_P(( void ));
|
||||
void tool_server_controls LDAP_P(( LDAP *, LDAPControl *, int ));
|
||||
int tool_check_abandon LDAP_P(( LDAP *ld, int msgid ));
|
||||
void tool_perror LDAP_P((
|
||||
char *func,
|
||||
int err,
|
||||
char *extra,
|
||||
char *matched,
|
||||
|
Loading…
Reference in New Issue
Block a user