/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
- * Copyright 1998-2011 The OpenLDAP Foundation.
+ * Copyright 1998-2012 The OpenLDAP Foundation.
* Portions Copyright 2010 Kurt D. Zeilenga.
* All rights reserved.
*
ldap_get_option(ld, LDAP_OPT_DIAGNOSTIC_MESSAGE, (void*) &text);
tool_perror( "ldap_verify_credentials_interactive", rc, NULL, NULL, text, NULL);
ldap_memfree(text);
- exit(rc);
+ tool_exit(ld, rc);
}
} while (rc == LDAP_SASL_BIND_IN_PROGRESS);
struct timeval tv;
if ( tool_check_abandon( ld, id ) ) {
- return LDAP_CANCELLED;
+ tool_exit( ld, LDAP_CANCELLED );
}
tv.tv_sec = 0;
rc = ldap_result( ld, LDAP_RES_ANY, LDAP_MSG_ALL, &tv, &res );
if ( rc < 0 ) {
tool_perror( "ldap_result", rc, NULL, NULL, NULL, NULL );
- return rc;
+ tool_exit( ld, rc );
}
if ( rc != 0 ) {
free( cred.bv_val );
/* disconnect from server */
- tool_unbind( ld );
- tool_destroy();
-
- return code == LDAP_SUCCESS ? EXIT_SUCCESS : EXIT_FAILURE;
+ tool_exit( ld, code == LDAP_SUCCESS ? EXIT_SUCCESS : EXIT_FAILURE );
}