mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-03-07 14:18:15 +08:00
Don't commit transactions if modify failed.
This commit is contained in:
parent
d15ce4d967
commit
f45cf3002f
@ -376,7 +376,7 @@ main( int argc, char **argv )
|
||||
}
|
||||
|
||||
#ifdef LDAP_X_TXN
|
||||
if( txn ) {
|
||||
if( retval == 0 && txn ) {
|
||||
rc = ldap_set_option( ld, LDAP_OPT_SERVER_CONTROLS, NULL );
|
||||
if ( rc != LDAP_OPT_SUCCESS ) {
|
||||
fprintf( stderr, "Could not unset controls for ldap_txn_end\n");
|
||||
@ -386,8 +386,7 @@ main( int argc, char **argv )
|
||||
rc = ldap_txn_end_s( ld, !txnabort, txn_id, NULL, NULL, NULL );
|
||||
if( rc != LDAP_SUCCESS ) {
|
||||
tool_perror( "ldap_txn_end_s", rc, NULL, NULL, NULL, NULL );
|
||||
if( txn > 1 ) return EXIT_FAILURE;
|
||||
txn = 0;
|
||||
retval = rc;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user