]> git.sur5r.net Git - openldap/commitdiff
Don't commit transactions if modify failed.
authorKurt Zeilenga <kurt@openldap.org>
Mon, 6 Mar 2006 22:25:11 +0000 (22:25 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Mon, 6 Mar 2006 22:25:11 +0000 (22:25 +0000)
clients/tools/ldapmodify.c

index ad789e4552b586c267f2c3213535a481b2aab989..51b99efd8c7870bc5a113653ce80ffe6730792de 100644 (file)
@@ -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