From: Pierangelo Masarati Date: Thu, 14 Jun 2007 23:07:40 +0000 (+0000) Subject: don't forget to log errors (ITS#5014) X-Git-Tag: OPENLDAP_REL_ENG_2_4_MP~386 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=844f13fbe8d390ef62aa763c65fb366184120795;p=openldap don't forget to log errors (ITS#5014) --- diff --git a/servers/slapd/syncrepl.c b/servers/slapd/syncrepl.c index e3f6891097..cf3d12421c 100644 --- a/servers/slapd/syncrepl.c +++ b/servers/slapd/syncrepl.c @@ -685,7 +685,8 @@ do_syncrep2( struct sync_cookie syncCookie_req = { NULL }; struct berval cookie = BER_BVNULL; - int rc, err; + int rc, + err = LDAP_SUCCESS; ber_len_t len; struct berval *psub; @@ -1048,13 +1049,14 @@ do_syncrep2( } if ( rc == -1 ) { - const char *errstr; - ldap_get_option( si->si_ld, LDAP_OPT_ERROR_NUMBER, &rc ); - errstr = ldap_err2string( rc ); - + err = rc; + } + + if ( err != LDAP_SUCCESS ) { Debug( LDAP_DEBUG_ANY, - "do_syncrep2: %s %s\n", si->si_ridtxt, errstr, 0 ); + "do_syncrep2: %s (%d) %s\n", + si->si_ridtxt, err, ldap_err2string( err ) ); } done: