]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-monitor/rww.c
more (in)sanity stuff
[openldap] / servers / slapd / back-monitor / rww.c
index 744c7a551138890f99d2a17c722ce0c9b42c401e..0edea5d0792aa5967a8535326d145f3be5dafe51 100644 (file)
 #include "lutil.h"
 #include "back-monitor.h"
 
+static int
+monitor_subsys_rww_update(
+       Operation               *op,
+       SlapReply               *rs,
+       Entry                   *e );
+
 enum {
        MONITOR_RWW_READ = 0,
        MONITOR_RWW_WRITE,
@@ -58,6 +64,8 @@ monitor_subsys_rww_init(
 
        assert( be != NULL );
 
+       ms->mss_update = monitor_subsys_rww_update;
+
        mi = ( monitor_info_t * )be->be_private;
 
        if ( monitor_cache_get( mi, &ms->mss_ndn, &e_conn ) ) {
@@ -139,11 +147,11 @@ monitor_subsys_rww_init(
        return( 0 );
 }
 
-int
+static int
 monitor_subsys_rww_update(
        Operation               *op,
-       Entry                   *e
-)
+       SlapReply               *rs,
+       Entry                   *e )
 {
        monitor_info_t *mi = (monitor_info_t *)op->o_bd->be_private;
        Connection      *c;
@@ -170,7 +178,7 @@ monitor_subsys_rww_update(
        }
 
        if ( i == MONITOR_RWW_LAST ) {
-               return 0;
+               return SLAP_CB_CONTINUE;
        }
 
        nconns = nwritewaiters = nreadwaiters = 0;
@@ -205,13 +213,13 @@ monitor_subsys_rww_update(
        snprintf( buf, sizeof( buf ), "%ld", num );
 
        a = attr_find( e->e_attrs, mi->mi_ad_monitorCounter );
-       assert( a );
+       assert( a != NULL );
        len = strlen( buf );
        if ( len > a->a_vals[ 0 ].bv_len ) {
                a->a_vals[ 0 ].bv_val = ber_memrealloc( a->a_vals[ 0 ].bv_val, len + 1 );
                if ( BER_BVISNULL( &a->a_vals[ 0 ] ) ) {
                        BER_BVZERO( &a->a_vals[ 0 ] );
-                       return( 0 );
+                       return SLAP_CB_CONTINUE;
                }
        }
        AC_MEMCPY( a->a_vals[ 0 ].bv_val, buf, len + 1 );
@@ -219,6 +227,6 @@ monitor_subsys_rww_update(
 
        /* FIXME: touch modifyTimestamp? */
 
-       return( 0 );
+       return SLAP_CB_CONTINUE;
 }