Skip to content
Snippets Groups Projects
Commit be14ac9f authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

Add error number to tool_perror() output

Don't hardcode function name.
parent 4537065f
No related branches found
No related tags found
No related merge requests found
......@@ -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,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment