From: Kurt Zeilenga Date: Mon, 6 Mar 2006 22:25:11 +0000 (+0000) Subject: Don't commit transactions if modify failed. X-Git-Tag: OPENLDAP_REL_ENG_2_4_BP~143 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=f45cf3002f0aef80085b1d044b385da0e16dfa9b;p=openldap Don't commit transactions if modify failed. --- diff --git a/clients/tools/ldapmodify.c b/clients/tools/ldapmodify.c index ad789e4552..51b99efd8c 100644 --- a/clients/tools/ldapmodify.c +++ b/clients/tools/ldapmodify.c @@ -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