int j;
Entry *e;
- bi = &backendInfo[i];
+ bi = &backendInfo[ i ];
snprintf( buf, sizeof( buf ),
"dn: cn=Backend %d,%s\n"
}
for ( j = 0; j < nBackendDB; j++ ) {
- BackendDB *be = &backendDB[j];
+ BackendDB *be = &backendDB[ j ];
char buf[ SLAP_LDAPDN_MAXLEN ];
struct berval dn;
&dn, NULL );
}
- mp = ( struct monitorentrypriv * )ch_calloc( sizeof( struct monitorentrypriv ), 1 );
+ mp = monitor_entrypriv_create();
+ if ( mp == NULL ) {
+ return -1;
+ }
e->e_private = ( void * )mp;
- mp->mp_next = NULL;
- mp->mp_children = NULL;
mp->mp_info = ms;
- mp->mp_flags = ms->mss_flags
- | MONITOR_F_SUB;
+ mp->mp_flags = ms->mss_flags | MONITOR_F_SUB;
if ( monitor_cache_add( mi, e ) ) {
Debug( LDAP_DEBUG_ANY,
BER_BVSTR( &bv, "0" );
attr_merge_one( e, mi->mi_ad_monitorCounter, &bv, NULL );
- mp = ( struct monitorentrypriv * )ch_calloc( sizeof( struct monitorentrypriv ), 1 );
+ mp = monitor_entrypriv_create();
+ if ( mp == NULL ) {
+ return -1;
+ }
e->e_private = ( void * )mp;
- mp->mp_next = NULL;
- mp->mp_children = NULL;
mp->mp_info = ms;
mp->mp_flags = ms->mss_flags \
| MONITOR_F_SUB | MONITOR_F_PERSISTENT;
BER_BVSTR( &bv, "0" );
attr_merge_one( e, mi->mi_ad_monitorCounter, &bv, NULL );
- mp = ( struct monitorentrypriv * )ch_calloc( sizeof( struct monitorentrypriv ), 1 );
+ mp = monitor_entrypriv_create();
+ if ( mp == NULL ) {
+ return -1;
+ }
e->e_private = ( void * )mp;
- mp->mp_next = NULL;
- mp->mp_children = NULL;
mp->mp_info = ms;
mp->mp_flags = ms->mss_flags \
| MONITOR_F_SUB | MONITOR_F_PERSISTENT;
attr_merge_one( e, mi->mi_ad_monitorConnectionPeerAddress,
&c->c_peer_name, NULL );
- mp = ( struct monitorentrypriv * )ch_calloc( sizeof( struct monitorentrypriv ), 1 );
+ mp = monitor_entrypriv_create();
+ if ( mp == NULL ) {
+ return -1;
+ }
e->e_private = ( void * )mp;
mp->mp_info = ms;
- mp->mp_children = NULL;
mp->mp_flags = MONITOR_F_SUB | MONITOR_F_VOLATILE;
*ep = e;
BackendInfo *bi;
Entry *e;
- be = &backendDB[i];
+ be = &backendDB[ i ];
bi = be->bd_info;
/* we must find it! */
assert( j >= 0 );
- mp = ( struct monitorentrypriv * )ch_calloc( sizeof( struct monitorentrypriv ), 1 );
+ mp = monitor_entrypriv_create();
+ if ( mp == NULL ) {
+ return -1;
+ }
e->e_private = ( void * )mp;
- mp->mp_next = NULL;
- mp->mp_children = NULL;
mp->mp_info = ms;
mp->mp_flags = ms->mss_flags
| MONITOR_F_SUB;
return LDAP_NO_SUCH_OBJECT;
/* do not allow some changes on back-monitor (needs work)... */
- be = &backendDB[n];
+ be = &backendDB[ n ];
if ( SLAP_MONITOR( be ) )
return LDAP_UNWILLING_TO_PERFORM;
goto done;
}
- if ( !bvmatch( &a->a_vals[0], tf ) ) {
+ if ( !bvmatch( &a->a_vals[ 0 ], tf ) ) {
attr_delete( &e->e_attrs, mi->mi_ad_readOnly );
rc = attr_merge_one( e, mi->mi_ad_readOnly, tf, NULL );
}
return( ( mp->mp_flags & cond ) || ( mp->mp_info->mss_flags & cond ) );
}
+struct monitorentrypriv *
+monitor_entrypriv_create( void )
+{
+ struct monitorentrypriv *mp;
+
+ mp = ( struct monitorentrypriv * )ch_calloc( sizeof( struct monitorentrypriv ), 1 );
+
+ mp->mp_next = NULL;
+ mp->mp_children = NULL;
+ mp->mp_info = NULL;
+ mp->mp_flags = MONITOR_F_NONE;
+ mp->mp_update = NULL;
+ mp->mp_private = NULL;
+
+ return mp;
+}
#ifdef INTEGRATE_CORE_SCHEMA
/* prepare for schema integration */
- for ( k = 0; mat[k].name != NULL; k++ );
+ for ( k = 0; mat[ k ].name != NULL; k++ );
#endif /* INTEGRATE_CORE_SCHEMA */
- for ( i = 0; mat_core[i].name != NULL; i++ ) {
+ for ( i = 0; mat_core[ i ].name != NULL; i++ ) {
AttributeDescription **ad;
const char *text;
- ad = ((AttributeDescription **)&(((char *)mi)[mat_core[i].offset]));
- ad[0] = NULL;
+ ad = ((AttributeDescription **)&(((char *)mi)[ mat_core[ i ].offset ]));
+ ad[ 0 ] = NULL;
- switch (slap_str2ad( mat_core[i].name, ad, &text ) ) {
+ switch (slap_str2ad( mat_core[ i ].name, ad, &text ) ) {
case LDAP_SUCCESS:
break;
#ifdef INTEGRATE_CORE_SCHEMA
case LDAP_UNDEFINED_TYPE:
- mat[k] = mat_core[i];
+ mat[ k ] = mat_core[ i ];
k++;
break;
#endif /* INTEGRATE_CORE_SCHEMA */
default:
Debug( LDAP_DEBUG_ANY,
"monitor_back_db_init: %s: %s\n",
- mat_core[i].name, text, 0 );
+ mat_core[ i ].name, text, 0 );
return( -1 );
}
}
/* schema integration */
- for ( i = 0; mat[i].name; i++ ) {
+ for ( i = 0; mat[ i ].name; i++ ) {
LDAPAttributeType *at;
int code;
const char *err;
AttributeDescription **ad;
- at = ldap_str2attributetype( mat[i].schema, &code,
+ at = ldap_str2attributetype( mat[ i ].schema, &code,
&err, LDAP_SCHEMA_ALLOW_ALL );
if ( !at ) {
Debug( LDAP_DEBUG_ANY, "monitor_back_db_init: "
"in AttributeType \"%s\" %s before %s\n",
- mat[i].name, ldap_scherr2str(code), err );
+ mat[ i ].name, ldap_scherr2str(code), err );
return -1;
}
if ( at->at_oid == NULL ) {
Debug( LDAP_DEBUG_ANY, "monitor_back_db_init: "
"null OID for attributeType \"%s\"\n",
- mat[i].name, 0, 0 );
+ mat[ i ].name, 0, 0 );
return -1;
}
if ( code ) {
Debug( LDAP_DEBUG_ANY, "monitor_back_db_init: "
"%s in attributeType \"%s\"\n",
- scherr2str(code), mat[i].name, 0 );
+ scherr2str(code), mat[ i ].name, 0 );
return -1;
}
ldap_memfree(at);
- ad = ((AttributeDescription **)&(((char *)mi)[mat[i].offset]));
- ad[0] = NULL;
- if ( slap_str2ad( mat[i].name, ad, &text ) ) {
+ ad = ((AttributeDescription **)&(((char *)mi)[ mat[ i ].offset ]));
+ ad[ 0 ] = NULL;
+ if ( slap_str2ad( mat[ i ].name, ad, &text ) ) {
Debug( LDAP_DEBUG_ANY,
"monitor_back_db_init: %s\n", text, 0, 0 );
return -1;
}
- (*ad)->ad_type->sat_flags |= mat[i].flags;
+ (*ad)->ad_type->sat_flags |= mat[ i ].flags;
}
- for ( i = 0; moc[i].name; i++ ) {
+ for ( i = 0; moc[ i ].name; i++ ) {
LDAPObjectClass *oc;
int code;
const char *err;
ObjectClass *Oc;
- oc = ldap_str2objectclass(moc[i].schema, &code, &err,
+ oc = ldap_str2objectclass(moc[ i ].schema, &code, &err,
LDAP_SCHEMA_ALLOW_ALL );
if ( !oc ) {
Debug( LDAP_DEBUG_ANY,
"unable to parse monitor objectclass \"%s\": "
- "%s before %s\n" , moc[i].name,
+ "%s before %s\n" , moc[ i ].name,
ldap_scherr2str(code), err );
return -1;
}
if ( oc->oc_oid == NULL ) {
Debug( LDAP_DEBUG_ANY,
"objectclass \"%s\" has no OID\n" ,
- moc[i].name, 0, 0 );
+ moc[ i ].name, 0, 0 );
return -1;
}
if ( code ) {
Debug( LDAP_DEBUG_ANY,
"objectclass \"%s\": %s \"%s\"\n" ,
- moc[i].name, scherr2str(code), err );
+ moc[ i ].name, scherr2str(code), err );
return -1;
}
ldap_memfree(oc);
- Oc = oc_find( moc[i].name );
+ Oc = oc_find( moc[ i ].name );
if ( Oc == NULL ) {
Debug( LDAP_DEBUG_ANY, "monitor_back_db_init: "
"unable to find objectClass %s "
- "(just added)\n", moc[i].name, 0, 0 );
+ "(just added)\n", moc[ i ].name, 0, 0 );
return -1;
}
- Oc->soc_flags |= moc[i].flags;
+ Oc->soc_flags |= moc[ i ].flags;
- ((ObjectClass **)&(((char *)mi)[moc[i].offset]))[0] = Oc;
+ ((ObjectClass **)&(((char *)mi)[ moc[ i ].offset ]))[ 0 ] = Oc;
}
return 0;
}
}
- mp = ( struct monitorentrypriv * )ch_calloc( sizeof( struct monitorentrypriv ), 1 );
+ mp = monitor_entrypriv_create();
+ if ( mp == NULL ) {
+ return -1;
+ }
e->e_private = ( void * )mp;
-
- mp->mp_info = NULL;
- mp->mp_children = NULL;
- mp->mp_next = NULL;
-
ep = &mp->mp_children;
if ( monitor_cache_add( mi, e ) ) {
return( -1 );
}
- mp = ( struct monitorentrypriv * )ch_calloc( sizeof( struct monitorentrypriv ), 1 );
+ mp = monitor_entrypriv_create();
+ if ( mp == NULL ) {
+ return -1;
+ }
e->e_private = ( void * )mp;
- mp->mp_next = NULL;
mp->mp_info = monitor_subsys[ i ];
- mp->mp_children = NULL;
mp->mp_flags = monitor_subsys[ i ]->mss_flags;
if ( monitor_cache_add( mi, e ) ) {
mp->mp_children = NULL;
ep = &mp->mp_children;
- for ( i = 0; l[i]; i++ ) {
+ for ( i = 0; l[ i ]; i++ ) {
char buf[ BACKMONITOR_BUFSIZE ];
Entry *e;
mi->mi_oc_monitoredObject->soc_cname.bv_val,
i,
mi->mi_ad_monitorConnectionLocalAddress->ad_cname.bv_val,
- l[i]->sl_name.bv_val,
- l[i]->sl_url.bv_val,
+ l[ i ]->sl_name.bv_val,
+ l[ i ]->sl_url.bv_val,
mi->mi_creatorsName.bv_val,
mi->mi_creatorsName.bv_val,
mi->mi_startTime.bv_val,
}
#ifdef HAVE_TLS
- if ( l[i]->sl_is_tls ) {
+ if ( l[ i ]->sl_is_tls ) {
struct berval bv;
bv.bv_val = "TLS";
}
#endif /* HAVE_TLS */
#ifdef LDAP_CONNECTIONLESS
- if ( l[i]->sl_is_udp ) {
+ if ( l[ i ]->sl_is_udp ) {
struct berval bv;
BER_BVSTR( &bv, "UDP" );
}
#endif /* HAVE_TLS */
- mp = ( struct monitorentrypriv * )ch_calloc( sizeof( struct monitorentrypriv ), 1 );
+ mp = monitor_entrypriv_create();
+ if ( mp == NULL ) {
+ return -1;
+ }
e->e_private = ( void * )mp;
- mp->mp_next = NULL;
- mp->mp_children = NULL;
mp->mp_info = ms;
mp->mp_flags = ms->mss_flags
| MONITOR_F_SUB;
{
int i;
- for ( i = 0; mod->sm_values && mod->sm_values[i].bv_val != NULL; i++ ) {
+ for ( i = 0; mod->sm_values && !BER_BVISNULL( &mod->sm_values[ i ] ); i++ ) {
int l;
- l = loglevel2int( &mod->sm_values[i] );
+ l = loglevel2int( &mod->sm_values[ i ] );
if ( !l ) {
return LDAP_CONSTRAINT_VIOLATION;
}
}
assert( int_2_level[ l ].s.bv_len
- == mod->sm_values[i].bv_len );
+ == mod->sm_values[ i ].bv_len );
- AC_MEMCPY( mod->sm_values[i].bv_val,
+ AC_MEMCPY( mod->sm_values[ i ].bv_val,
int_2_level[ l ].s.bv_val,
int_2_level[ l ].s.bv_len );
- AC_MEMCPY( mod->sm_nvalues[i].bv_val,
+ AC_MEMCPY( mod->sm_nvalues[ i ].bv_val,
int_2_level[ l ].n.bv_val,
int_2_level[ l ].n.bv_len );
return LDAP_INAPPROPRIATE_MATCHING;
}
- for ( i = 0; mod->sm_values[i].bv_val != NULL; i++ ) {
+ for ( i = 0; !BER_BVISNULL( &mod->sm_values[ i ] ); i++ ) {
int rc;
int j;
const char *text = NULL;
rc = asserted_value_validate_normalize(
mod->sm_desc, mr, SLAP_MR_EQUALITY,
- &mod->sm_values[i], &asserted, &text, NULL );
+ &mod->sm_values[ i ], &asserted, &text, NULL );
if ( rc != LDAP_SUCCESS ) {
return rc;
}
- for ( j = 0; a->a_vals[j].bv_val != NULL; j++ ) {
+ for ( j = 0; !BER_BVISNULL( &a->a_vals[ j ] ); j++ ) {
int match;
int rc = value_match( &match, mod->sm_desc, mr,
- 0, &a->a_vals[j], &asserted, &text );
+ 0, &a->a_vals[ j ], &asserted, &text );
if ( rc == LDAP_SUCCESS && match == 0 ) {
free( asserted.bv_val );
}
/* find each value to delete */
- for ( i = 0; mod->sm_values[i].bv_val != NULL; i++ ) {
+ for ( i = 0; !BER_BVISNULL( &mod->sm_values[ i ] ); i++ ) {
int rc;
const char *text = NULL;
rc = asserted_value_validate_normalize(
mod->sm_desc, mr, SLAP_MR_EQUALITY,
- &mod->sm_values[i], &asserted, &text, NULL );
+ &mod->sm_values[ i ], &asserted, &text, NULL );
if( rc != LDAP_SUCCESS ) return rc;
found = 0;
- for ( j = 0; a->a_vals[j].bv_val != NULL; j++ ) {
+ for ( j = 0; !BER_BVISNULL( &a->a_vals[ j ] ); j++ ) {
int match;
int rc = value_match( &match, mod->sm_desc, mr,
0,
- &a->a_vals[j], &asserted, &text );
+ &a->a_vals[ j ], &asserted, &text );
if( rc == LDAP_SUCCESS && match != 0 ) {
continue;
found = 1;
/* delete it */
- free( a->a_vals[j].bv_val );
- for ( k = j + 1; a->a_vals[k].bv_val != NULL; k++ ) {
- a->a_vals[k - 1] = a->a_vals[k];
+ free( a->a_vals[ j ].bv_val );
+ for ( k = j + 1; !BER_BVISNULL( &a->a_vals[ k ] ); k++ ) {
+ a->a_vals[ k - 1 ] = a->a_vals[ k ];
}
- a->a_vals[k - 1].bv_val = NULL;
+ BER_BVZERO( &a->a_vals[ k - 1 ] );
break;
}
}
/* if no values remain, delete the entire attribute */
- if ( a->a_vals[0].bv_val == NULL ) {
+ if ( BER_BVISNULL( &a->a_vals[ 0 ] ) ) {
/* should already be zero */
*newlevel = 0;
ms->mss_dn.bv_val,
mi->mi_oc_monitorOperation->soc_cname.bv_val,
mi->mi_oc_monitorOperation->soc_cname.bv_val,
- &monitor_op[ i ].rdn.bv_val[STRLENOF( "cn=" )],
+ &monitor_op[ i ].rdn.bv_val[ STRLENOF( "cn=" ) ],
mi->mi_ad_monitorOpInitiated->ad_cname.bv_val,
mi->mi_ad_monitorOpCompleted->ad_cname.bv_val,
mi->mi_creatorsName.bv_val,
/* steal normalized RDN */
dnRdn( &e->e_nname, &rdn );
- ber_dupbv( &monitor_op[i].nrdn, &rdn );
+ ber_dupbv( &monitor_op[ i ].nrdn, &rdn );
- mp = ( struct monitorentrypriv * )ch_calloc( sizeof( struct monitorentrypriv ), 1 );
+ mp = monitor_entrypriv_create();
+ if ( mp == NULL ) {
+ return -1;
+ }
e->e_private = ( void * )mp;
- mp->mp_next = NULL;
- mp->mp_children = NULL;
mp->mp_info = ms;
mp->mp_flags = ms->mss_flags \
| MONITOR_F_SUB | MONITOR_F_PERSISTENT;
&bv, NULL );
for ( j = 0; j < nBackendDB; j++ ) {
- BackendDB *be = &backendDB[j];
+ BackendDB *be = &backendDB[ j ];
char buf[ SLAP_LDAPDN_MAXLEN ];
struct berval dn;
slap_overinst *on2;
&dn, NULL );
}
- mp = ( struct monitorentrypriv * )ch_calloc( sizeof( struct monitorentrypriv ), 1 );
+ mp = monitor_entrypriv_create();
+ if ( mp == NULL ) {
+ return -1;
+ }
e->e_private = ( void * )mp;
- mp->mp_next = NULL;
- mp->mp_children = NULL;
mp->mp_info = ms;
mp->mp_flags = ms->mss_flags
| MONITOR_F_SUB;
Entry *e_parent, Entry **ep ));
extern int monitor_entry_modify LDAP_P(( Operation *op, Entry *e ));
int monitor_entry_test_flags LDAP_P(( struct monitorentrypriv *mp, int cond ));
+extern struct monitorentrypriv * monitor_entrypriv_create LDAP_P(( void ));
/*
* init
"modifiersName: %s\n"
"createTimestamp: %s\n"
"modifyTimestamp: %s\n",
- monitor_rww[i].rdn.bv_val,
+ monitor_rww[ i ].rdn.bv_val,
ms->mss_dn.bv_val,
mi->mi_oc_monitorCounterObject->soc_cname.bv_val,
mi->mi_oc_monitorCounterObject->soc_cname.bv_val,
- &monitor_rww[i].rdn.bv_val[STRLENOF("cn")],
+ &monitor_rww[ i ].rdn.bv_val[ STRLENOF( "cn=" ) ],
mi->mi_creatorsName.bv_val,
mi->mi_creatorsName.bv_val,
mi->mi_startTime.bv_val,
/* steal normalized RDN */
dnRdn( &e->e_nname, &nrdn );
- ber_dupbv( &monitor_rww[i].nrdn, &nrdn );
+ ber_dupbv( &monitor_rww[ i ].nrdn, &nrdn );
BER_BVSTR( &bv, "0" );
attr_merge_one( e, mi->mi_ad_monitorCounter, &bv, NULL );
- mp = ( struct monitorentrypriv * )ch_calloc( sizeof( struct monitorentrypriv ), 1 );
+ mp = monitor_entrypriv_create();
+ if ( mp == NULL ) {
+ return -1;
+ }
e->e_private = ( void * )mp;
- mp->mp_next = NULL;
- mp->mp_children = NULL;
mp->mp_info = ms;
mp->mp_flags = ms->mss_flags \
| MONITOR_F_SUB | MONITOR_F_PERSISTENT;
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_rww_init: "
"unable to add entry \"%s,%s\"\n",
- monitor_rww[i].rdn.bv_val,
+ monitor_rww[ i ].rdn.bv_val,
ms->mss_ndn.bv_val, 0 );
return( -1 );
}
dnRdn( &e->e_nname, &nrdn );
- for ( i = 0; !BER_BVISNULL( &monitor_rww[i].nrdn ); i++ ) {
- if ( dn_match( &nrdn, &monitor_rww[i].nrdn ) ) {
+ for ( i = 0; !BER_BVISNULL( &monitor_rww[ i ].nrdn ); i++ ) {
+ if ( dn_match( &nrdn, &monitor_rww[ i ].nrdn ) ) {
break;
}
}
a = attr_find( e->e_attrs, mi->mi_ad_monitorCounter );
assert( a );
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 ( a->a_vals[0].bv_val == NULL ) {
- BER_BVZERO( &a->a_vals[0] );
+ 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 );
}
}
- AC_MEMCPY( a->a_vals[0].bv_val, buf, len + 1 );
+ AC_MEMCPY( a->a_vals[ 0 ].bv_val, buf, len + 1 );
a->a_vals[ 0 ].bv_len = len;
return( 0 );
"modifiersName: %s\n"
"createTimestamp: %s\n"
"modifyTimestamp: %s\n",
- monitor_sent[i].rdn.bv_val,
+ monitor_sent[ i ].rdn.bv_val,
ms->mss_dn.bv_val,
mi->mi_oc_monitorCounterObject->soc_cname.bv_val,
mi->mi_oc_monitorCounterObject->soc_cname.bv_val,
- &monitor_sent[i].rdn.bv_val[STRLENOF( "cn=" )],
+ &monitor_sent[ i ].rdn.bv_val[ STRLENOF( "cn=" ) ],
mi->mi_creatorsName.bv_val,
mi->mi_creatorsName.bv_val,
mi->mi_startTime.bv_val,
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_sent_init: "
"unable to create entry \"%s,%s\"\n",
- monitor_sent[i].rdn.bv_val,
+ monitor_sent[ i ].rdn.bv_val,
ms->mss_ndn.bv_val, 0 );
return( -1 );
}
/* steal normalized RDN */
dnRdn( &e->e_nname, &nrdn );
- ber_dupbv( &monitor_sent[i].nrdn, &nrdn );
+ ber_dupbv( &monitor_sent[ i ].nrdn, &nrdn );
BER_BVSTR( &bv, "0" );
attr_merge_one( e, mi->mi_ad_monitorCounter, &bv, NULL );
- mp = ( struct monitorentrypriv * )ch_calloc( sizeof( struct monitorentrypriv ), 1 );
+ mp = monitor_entrypriv_create();
+ if ( mp == NULL ) {
+ return -1;
+ }
e->e_private = ( void * )mp;
- mp->mp_next = NULL;
- mp->mp_children = NULL;
mp->mp_info = ms;
mp->mp_flags = ms->mss_flags \
| MONITOR_F_SUB | MONITOR_F_PERSISTENT;
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_sent_init: "
"unable to add entry \"%s,%s\"\n",
- monitor_sent[i].rdn.bv_val,
+ monitor_sent[ i ].rdn.bv_val,
ms->mss_ndn.bv_val, 0 );
return( -1 );
}
dnRdn( &e->e_nname, &nrdn );
for ( i = 0; i < MONITOR_SENT_LAST; i++ ) {
- if ( dn_match( &nrdn, &monitor_sent[i].nrdn ) ) {
+ if ( dn_match( &nrdn, &monitor_sent[ i ].nrdn ) ) {
break;
}
}
return( -1 );
}
- mp = ( struct monitorentrypriv * )ch_calloc( sizeof( struct monitorentrypriv ), 1 );
+ mp = monitor_entrypriv_create();
+ if ( mp == NULL ) {
+ return -1;
+ }
e->e_private = ( void * )mp;
- mp->mp_next = NULL;
- mp->mp_children = NULL;
mp->mp_info = ms;
mp->mp_flags = ms->mss_flags \
| MONITOR_F_SUB | MONITOR_F_PERSISTENT;
return( -1 );
}
- mp = ( struct monitorentrypriv * )ch_calloc( sizeof( struct monitorentrypriv ), 1 );
+ mp = monitor_entrypriv_create();
+ if ( mp == NULL ) {
+ return -1;
+ }
e->e_private = ( void * )mp;
- mp->mp_next = NULL;
- mp->mp_children = NULL;
mp->mp_info = ms;
mp->mp_flags = ms->mss_flags \
| MONITOR_F_SUB | MONITOR_F_PERSISTENT;
return( -1 );
}
- mp = ( struct monitorentrypriv * )ch_calloc( sizeof( struct monitorentrypriv ), 1 );
+ mp = monitor_entrypriv_create();
+ if ( mp == NULL ) {
+ return -1;
+ }
e->e_private = ( void * )mp;
- mp->mp_next = NULL;
- mp->mp_children = NULL;
mp->mp_info = ms;
mp->mp_flags = ms->mss_flags \
| MONITOR_F_SUB | MONITOR_F_PERSISTENT;
return( -1 );
}
- mp = ( struct monitorentrypriv * )ch_calloc( sizeof( struct monitorentrypriv ), 1 );
+ mp = monitor_entrypriv_create();
+ if ( mp == NULL ) {
+ return -1;
+ }
e->e_private = ( void * )mp;
- mp->mp_next = NULL;
- mp->mp_children = NULL;
mp->mp_info = ms;
mp->mp_flags = ms->mss_flags \
| MONITOR_F_SUB | MONITOR_F_PERSISTENT;
return( -1 );
}
- assert( len == a->a_vals[0].bv_len );
- AC_MEMCPY( a->a_vals[0].bv_val, tmbuf, len );
+ assert( len == a->a_vals[ 0 ].bv_len );
+ AC_MEMCPY( a->a_vals[ 0 ].bv_val, tmbuf, len );
}
return( 0 );