ITS#6758 rs_reinit() += slap_reply_t parameter

This commit is contained in:
Hallvard Furuseth 2010-12-31 09:45:16 +00:00
parent b120b2a05b
commit cb15a4c687
2 changed files with 9 additions and 5 deletions

View File

@ -1544,13 +1544,18 @@ LDAP_SLAPD_F (int) get_alias_dn LDAP_P((
# define rs_assert_ok(rs) ((void) (rs))
# define rs_assert_ready(rs) ((void) (rs))
# define rs_assert_done(rs) ((void) (rs))
# define rs_reinit(rs) ((void) memset( rs, 0, sizeof(SlapReply) ))
#endif
LDAP_SLAPD_F (void) (rs_assert_ok) LDAP_P(( const SlapReply *rs ));
LDAP_SLAPD_F (void) (rs_assert_ready) LDAP_P(( const SlapReply *rs ));
LDAP_SLAPD_F (void) (rs_assert_done) LDAP_P(( const SlapReply *rs ));
LDAP_SLAPD_F (void) (rs_reinit) LDAP_P(( SlapReply *rs ));
#define rs_reinit(rs, type) do { \
SlapReply *const rsRI = (rs); \
rs_assert_done( rsRI ); \
memset( rsRI, 0, sizeof(*rsRI) ); \
rsRI->sr_type = (type); \
} while ( 0 )
LDAP_SLAPD_F (void) (rs_reinit) LDAP_P(( SlapReply *rs, slap_reply_t type ));
LDAP_SLAPD_F (void) rs_flush_entry LDAP_P(( Operation *op,
SlapReply *rs, slap_overinst *on ));
LDAP_SLAPD_F (void) rs_replace_entry LDAP_P(( Operation *op,

View File

@ -192,10 +192,9 @@ void
/* Reset a used SlapReply whose contents has been flushed (freed/released) */
void
(rs_reinit)( SlapReply *rs )
(rs_reinit)( SlapReply *rs, slap_reply_t type )
{
rs_assert_done( rs );
memset( rs, 0, sizeof(SlapReply) );
rs_reinit( rs, type ); /* proto-slap.h macro */
}
/* Obey and clear rs->sr_flags & REP_ENTRY_MASK. Clear sr_entry if freed. */