X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=libraries%2Flibldap%2Fldap_sync.c;h=d8c5b4404944ef8853debc85f1c1977d849c5745;hb=6c1d48aa8d066ff85809b8a544952ad2d1dc3400;hp=8db70ada2801960d0d22142adfc2adf6b1835805;hpb=3c5068bc1fa84fc5daf1e50d4f1a929cec91b7e9;p=openldap diff --git a/libraries/libldap/ldap_sync.c b/libraries/libldap/ldap_sync.c index 8db70ada28..d8c5b44049 100644 --- a/libraries/libldap/ldap_sync.c +++ b/libraries/libldap/ldap_sync.c @@ -1,7 +1,7 @@ /* $OpenLDAP$ */ /* This work is part of OpenLDAP Software . * - * Copyright 2006-2007 The OpenLDAP Foundation. + * Copyright 2006-2010 The OpenLDAP Foundation. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -29,34 +29,6 @@ #include "ldap-int.h" #ifdef LDAP_SYNC_TRACE -/* - * used for debug purposes - */ -static char * -print_UUID( char *buf, size_t len, unsigned char *UUID ) -{ - snprintf( buf, len, - "%02x%02x%02x%02x-%02x%02x-%02x%02x-" - "%02x%02x-%02x%02x%02x%02x%02x%02x", - UUID[0], - UUID[1], - UUID[2], - UUID[3], - UUID[4], - UUID[5], - UUID[6], - UUID[7], - UUID[8], - UUID[9], - UUID[10], - UUID[11], - UUID[12], - UUID[13], - UUID[14], - UUID[15] ); - return buf; -} - static const char * ldap_sync_state2str( int state ) { @@ -600,8 +572,9 @@ ldap_sync_search_intermediate( ldap_sync_t *ls, LDAPMessage *res, int *refreshDo for ( i = 0; syncUUIDs[ i ].bv_val != NULL; i++ ) { char buf[ BUFSIZ ]; fprintf( stderr, "\t\t%s\n", - print_UUID( buf, sizeof( buf ), - (unsigned char *)syncUUIDs[ i ].bv_val ) ); + lutil_uuidstr_from_normalized( + syncUUIDs[ i ].bv_val, syncUUIDs[ i ].bv_len, + buf, sizeof( buf ) ) ); } } #endif /* LDAP_SYNC_TRACE */ @@ -718,7 +691,7 @@ ldap_sync_init( ldap_sync_t *ls, int mode ) rc ? "!!! " : "", rc ); #endif /* LDAP_SYNC_TRACE */ - if ( rc == LBER_ERROR ) { + if ( rc < 0 ) { rc = LDAP_OTHER; goto done; }