]> git.sur5r.net Git - openldap/commitdiff
use a placeholder to mark that there is no process in the runqueue (ITS#4318)
authorPierangelo Masarati <ando@openldap.org>
Mon, 9 Jan 2006 15:45:59 +0000 (15:45 +0000)
committerPierangelo Masarati <ando@openldap.org>
Mon, 9 Jan 2006 15:45:59 +0000 (15:45 +0000)
servers/slapd/back-monitor/thread.c

index 465e8645193001285ec906b38246197b20464b22..2e4ded453561b80228588b95535e49f4996a75e1 100644 (file)
@@ -271,9 +271,9 @@ monitor_subsys_thread_update(
                break;
 
        case 2:
-               for ( i = 0; !BER_BVISNULL( a->a_vals + i ); i++) {
+               for ( i = 0; !BER_BVISNULL( &a->a_vals[ i ] ); i++ ) {
                        ch_free( a->a_vals[i].bv_val );
-                       BER_BVZERO( a->a_vals + i );
+                       BER_BVZERO( &a->a_vals[ i ] );
                }
                bv.bv_val = buf;
                ldap_pvt_thread_mutex_lock( &slapd_rq.rq_mutex );
@@ -283,6 +283,12 @@ monitor_subsys_thread_update(
                        value_add_one( &a->a_vals, &bv );
                }
                ldap_pvt_thread_mutex_unlock( &slapd_rq.rq_mutex );
+
+               /* don't leave 'round attributes with no values */
+               if ( BER_BVISNULL( &a->a_vals[ 0 ] ) ) {
+                       BER_BVSTR( &bv, "()" );
+                       value_add_one( &a->a_vals, &bv );
+               }
                break;
        }