]> git.sur5r.net Git - openldap/commitdiff
logging psearch return code
authorJong Hyuk Choi <jongchoi@openldap.org>
Mon, 28 Jun 2004 23:51:17 +0000 (23:51 +0000)
committerJong Hyuk Choi <jongchoi@openldap.org>
Mon, 28 Jun 2004 23:51:17 +0000 (23:51 +0000)
servers/slapd/back-bdb/add.c
servers/slapd/back-bdb/delete.c
servers/slapd/back-bdb/modify.c
servers/slapd/back-bdb/modrdn.c

index 67a24b73d05414259036893cf21a1c6cd5e9b240..104b289d7a39ed1b5cb7d739eab2f25136f04c41 100644 (file)
@@ -504,8 +504,18 @@ retry:     /* transaction retry */
                        ldap_pvt_thread_rdwr_wlock( &bdb->bi_pslist_rwlock );
                        assert( BEI(e) );
                        LDAP_LIST_FOREACH ( ps_list, &bdb->bi_psearch_list, o_ps_link ) {
-                               bdb_psearch( op, rs, ps_list, e,
-                                       LDAP_PSEARCH_BY_ADD );
+                               rc = bdb_psearch( op, rs, ps_list, e, LDAP_PSEARCH_BY_ADD );
+                               if ( rc ) {
+#ifdef NEW_LOGGING
+                                       LDAP_LOG ( OPERATION, ERR, 
+                                               "bdb_add: persistent search failed (%d,%d)\n",
+                                               rc, rs->sr_err, 0 );
+#else
+                                       Debug( LDAP_DEBUG_TRACE,
+                                               "bdb_add: persistent search failed (%d,%d)\n",
+                                               rc, rs->sr_err, 0 );
+#endif
+                               }
                        }
                        ldap_pvt_thread_rdwr_wunlock( &bdb->bi_pslist_rwlock );
                }
index 36ef298003b312f422f2ad400706589987162975..148230ec01419f82c4c69cc716a66853a7647e82 100644 (file)
@@ -581,7 +581,18 @@ retry:     /* transaction retry */
                if ( rs->sr_err == LDAP_SUCCESS && !op->o_no_psearch ) {
                        ldap_pvt_thread_rdwr_wlock( &bdb->bi_pslist_rwlock );
                        LDAP_LIST_FOREACH( ps_list, &bdb->bi_psearch_list, o_ps_link ) {
-                               bdb_psearch( op, rs, ps_list, e, LDAP_PSEARCH_BY_DELETE );
+                               rc = bdb_psearch( op, rs, ps_list, e, LDAP_PSEARCH_BY_DELETE );
+                               if ( rc ) {
+#ifdef NEW_LOGGING
+                                       LDAP_LOG ( OPERATION, ERR,
+                                               "bdb_delete: persistent search failed (%d,%d)\n",
+                                               rc, rs->sr_err, 0 );
+#else
+                                       Debug( LDAP_DEBUG_TRACE,
+                                               "bdb_delete: persistent search failed (%d,%d)\n",
+                                               rc, rs->sr_err, 0 );
+#endif
+                               }
                        }
                        ldap_pvt_thread_rdwr_wunlock( &bdb->bi_pslist_rwlock );
                }
index b2a14b022811b5e1b32aeaed6c8a9e99bc0e76e4..3c2d47e044260ab8450282c905e54092d8ae8589 100644 (file)
@@ -542,7 +542,18 @@ retry:     /* transaction retry */
        if ( rs->sr_err == LDAP_SUCCESS && !op->o_noop && !op->o_no_psearch ) {
                ldap_pvt_thread_rdwr_wlock( &bdb->bi_pslist_rwlock );
                LDAP_LIST_FOREACH ( ps_list, &bdb->bi_psearch_list, o_ps_link ) {
-                       bdb_psearch(op, rs, ps_list, e, LDAP_PSEARCH_BY_PREMODIFY );
+                       rc = bdb_psearch(op, rs, ps_list, e, LDAP_PSEARCH_BY_PREMODIFY );
+                       if ( rc ) {
+#ifdef NEW_LOGGING
+                               LDAP_LOG ( OPERATION, ERR,
+                                       "bdb_modify: persistent search failed (%d,%d)\n",
+                                       rc, rs->sr_err, 0 );
+#else
+                               Debug( LDAP_DEBUG_TRACE,
+                                       "bdb_modify: persistent search failed (%d,%d)\n",
+                                       rc, rs->sr_err, 0 );
+#endif
+                       }
                }
                ldap_pvt_thread_rdwr_wunlock( &bdb->bi_pslist_rwlock );
        }
@@ -691,12 +702,34 @@ retry:    /* transaction retry */
                        /* Loop through in-scope entries for each psearch spec */
                        ldap_pvt_thread_rdwr_wlock( &bdb->bi_pslist_rwlock );
                        LDAP_LIST_FOREACH ( ps_list, &bdb->bi_psearch_list, o_ps_link ) {
-                               bdb_psearch( op, rs, ps_list, e, LDAP_PSEARCH_BY_MODIFY );
+                               rc = bdb_psearch( op, rs, ps_list, e, LDAP_PSEARCH_BY_MODIFY );
+                               if ( rc ) {
+#ifdef NEW_LOGGING
+                                       LDAP_LOG ( OPERATION, ERR,
+                                               "bdb_modify: persistent search failed (%d,%d)\n",
+                                               rc, rs->sr_err, 0 );
+#else
+                                       Debug( LDAP_DEBUG_TRACE,
+                                               "bdb_modify: persistent search failed (%d,%d)\n",
+                                               rc, rs->sr_err, 0 );
+#endif
+                               }
                        }
                        pm_list = LDAP_LIST_FIRST(&op->o_pm_list);
                        while ( pm_list != NULL ) {
-                               bdb_psearch(op, rs, pm_list->ps_op,
+                               rc = bdb_psearch(op, rs, pm_list->ps_op,
                                                        e, LDAP_PSEARCH_BY_SCOPEOUT);
+                               if ( rc ) {
+#ifdef NEW_LOGGING
+                                       LDAP_LOG ( OPERATION, ERR,
+                                               "bdb_modify: persistent search failed (%d,%d)\n",
+                                               rc, rs->sr_err, 0 );
+#else
+                                       Debug( LDAP_DEBUG_TRACE,
+                                               "bdb_modify: persistent search failed (%d,%d)\n",
+                                               rc, rs->sr_err, 0 );
+#endif
+                               }
                                LDAP_LIST_REMOVE ( pm_list, ps_link );
                                pm_prev = pm_list;
                                pm_list = LDAP_LIST_NEXT ( pm_list, ps_link );
index 11651e0b281c1ffca395cc7da51a9798d560c9d6..8d29504e7cf869ef2932866d2c2766e54a234d17 100644 (file)
@@ -896,7 +896,18 @@ retry:     /* transaction retry */
        if ( rs->sr_err == LDAP_SUCCESS && !op->o_noop && !op->o_no_psearch ) {
                ldap_pvt_thread_rdwr_wlock( &bdb->bi_pslist_rwlock );
                LDAP_LIST_FOREACH ( ps_list, &bdb->bi_psearch_list, o_ps_link ) {
-                       bdb_psearch( op, rs, ps_list, e, LDAP_PSEARCH_BY_PREMODIFY );
+                       rc = bdb_psearch( op, rs, ps_list, e, LDAP_PSEARCH_BY_PREMODIFY );
+                       if ( rc ) {
+#ifdef NEW_LOGGING
+                               LDAP_LOG ( OPERATION, ERR,
+                                       "bdb_modrdn: persistent search failed (%d,%d)\n",
+                                       rc, rs->sr_err, 0 );
+#else
+                               Debug( LDAP_DEBUG_TRACE,
+                                       "bdb_modrdn: persistent search failed (%d,%d)\n",
+                                       rc, rs->sr_err, 0 );
+#endif
+                       }
                }
                ldap_pvt_thread_rdwr_wunlock( &bdb->bi_pslist_rwlock );
        }
@@ -1041,12 +1052,34 @@ retry:  /* transaction retry */
                        /* Loop through in-scope entries for each psearch spec */
                        ldap_pvt_thread_rdwr_wlock( &bdb->bi_pslist_rwlock );
                        LDAP_LIST_FOREACH ( ps_list, &bdb->bi_psearch_list, o_ps_link ) {
-                               bdb_psearch( op, rs, ps_list, e, LDAP_PSEARCH_BY_MODIFY );
+                               rc = bdb_psearch( op, rs, ps_list, e, LDAP_PSEARCH_BY_MODIFY );
+                               if ( rc ) {
+#ifdef NEW_LOGGING
+                                       LDAP_LOG ( OPERATION, ERR,
+                                               "bdb_modrdn: persistent search failed (%d,%d)\n",
+                                               rc, rs->sr_err, 0 );
+#else
+                                       Debug( LDAP_DEBUG_TRACE,
+                                               "bdb_modrdn: persistent search failed (%d,%d)\n",
+                                               rc, rs->sr_err, 0 );
+#endif
+                       }
                        }
                        pm_list = LDAP_LIST_FIRST(&op->o_pm_list);
                        while ( pm_list != NULL ) {
-                               bdb_psearch(op, rs, pm_list->ps_op,
+                               rc = bdb_psearch(op, rs, pm_list->ps_op,
                                                        e, LDAP_PSEARCH_BY_SCOPEOUT);
+                               if ( rc ) {
+#ifdef NEW_LOGGING
+                                       LDAP_LOG ( OPERATION, ERR,
+                                               "bdb_modrdn: persistent search failed (%d,%d)\n",
+                                               rc, rs->sr_err, 0 );
+#else
+                                       Debug( LDAP_DEBUG_TRACE,
+                                               "bdb_modrdn: persistent search failed (%d,%d)\n",
+                                               rc, rs->sr_err, 0 );
+#endif
+                               }
                                pm_prev = pm_list;
                                LDAP_LIST_REMOVE ( pm_list, ps_link );
                                pm_list = LDAP_LIST_NEXT ( pm_list, ps_link );