]> git.sur5r.net Git - openldap/commitdiff
Update (-c) continue error handling
authorKurt Zeilenga <kurt@openldap.org>
Thu, 17 Oct 2002 17:13:10 +0000 (17:13 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Thu, 17 Oct 2002 17:13:10 +0000 (17:13 +0000)
clients/tools/ldapmodify.c

index 245619e25de6e6cf58449cf54ba8b0a02ae2ca21..dab8344c6195baac7a09e9c88101a0084cb42d93 100644 (file)
@@ -154,7 +154,8 @@ main( int argc, char **argv )
     char               *infile, *rejfile, *rbuf, *start, *rejbuf = NULL;
     FILE               *fp, *rejfp;
        char            *matched_msg = NULL, *error_msg = NULL;
-       int             rc, i, authmethod, version, want_bindpw, debug, manageDSAit, noop, referrals;
+       int             rc, retval, i, authmethod, version, want_bindpw;
+       int             debug, manageDSAit, noop, referrals;
        int count, len;
        char    *pw_file = NULL;
        char    *control, *cvalue;
@@ -824,6 +825,7 @@ main( int argc, char **argv )
        }
 
        count = 0;
+       retval = 0;
     while (( rc == 0 || contoper ) &&
                ( rbuf = read_one_record( fp )) != NULL ) {
        count++;
@@ -841,6 +843,8 @@ main( int argc, char **argv )
 
     rc = process_ldif_rec( start, count );
 
+       if ( rc )
+               retval = rc;
        if ( rc && rejfp ) {
                fprintf(rejfp, "# Error: %s (%d)", ldap_err2string(rc), rc);
 
@@ -868,7 +872,7 @@ main( int argc, char **argv )
            fclose( rejfp );
     }
 
-       return( rc );
+    return( retval );
 }