LDAPMessage *res;
int rc = LDAP_OTHER;
- if( ldap_result( ld, msgid, txn ? 0 : 1, NULL, &res ) == -1 ) {
+ if( ldap_result( ld, msgid,
+#ifdef LDAP_GROUP_TRANSACTION
+ txn ? 0 : 1,
+#else
+ 1,
+#endif
+ NULL, &res ) == -1 ) {
ldap_get_option( ld, LDAP_OPT_ERROR_NUMBER, &rc );
return rc;
}
if( ldap_msgtype( res ) != LDAP_RES_INTERMEDIATE ) {
- return ldap_result2error( ld, res, 1 );
+ rc = ldap_result2error( ld, res, 1 );
+ if (rc) ldap_perror( ld, opstr );
+ return rc;
}
#ifdef LDAP_GROUP_TRANSACTION