]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-bdb/operational.c
return structuralObjectClass errors
[openldap] / servers / slapd / back-bdb / operational.c
index 7c4590e6c203aecfe72b3a3e78573217b36ffa06..ad23046d62a60fa89f7fd59b1f5418051f1a6ceb 100644 (file)
@@ -2,7 +2,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 2000-2004 The OpenLDAP Foundation.
+ * Copyright 2000-2006 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -36,7 +36,7 @@ bdb_hasSubordinates(
 {
        int             rc;
        
-       assert( e );
+       assert( e != NULL );
 
        /* NOTE: this should never happen, but it actually happens
         * when using back-relay; until we find a better way to
@@ -56,7 +56,6 @@ retry:
        switch( rc ) {
        case DB_LOCK_DEADLOCK:
        case DB_LOCK_NOTGRANTED:
-               ldap_pvt_thread_yield();
                goto retry;
 
        case 0:
@@ -89,7 +88,7 @@ bdb_operational(
 {
        Attribute       **ap;
 
-       assert( rs->sr_entry );
+       assert( rs->sr_entry != NULL );
 
        for ( ap = &rs->sr_operational_attrs; *ap; ap = &(*ap)->a_next )
                /* just count */ ;
@@ -97,17 +96,17 @@ bdb_operational(
        if ( SLAP_OPATTRS( rs->sr_attr_flags ) ||
                        ad_inlist( slap_schema.si_ad_hasSubordinates, rs->sr_attrs ) )
        {
-               int     hasSubordinates;
+               int     hasSubordinates, rc;
 
-               rs->sr_err = bdb_hasSubordinates( op, rs->sr_entry, &hasSubordinates );
-               if ( rs->sr_err == LDAP_SUCCESS ) {
+               rc = bdb_hasSubordinates( op, rs->sr_entry, &hasSubordinates );
+               if ( rc == LDAP_SUCCESS ) {
                        *ap = slap_operational_hasSubordinate( hasSubordinates == LDAP_COMPARE_TRUE );
-                       assert( *ap );
+                       assert( *ap != NULL );
 
                        ap = &(*ap)->a_next;
                }
        }
 
-       return rs->sr_err;
+       return LDAP_SUCCESS;
 }