From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17761 invoked by alias); 11 Mar 2009 11:43:17 -0000 Received: (qmail 17755 invoked by alias); 11 Mar 2009 11:43:17 -0000 X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_43,SPF_HELO_PASS X-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_43,SPF_HELO_PASS X-Spam-Check-By: sourceware.org X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bastion.fedora.phx.redhat.com Subject: cluster: STABLE3 - config: make confdb2ldap compile with latest corosync To: cluster-cvs-relay@redhat.com X-Project: Cluster Project X-Git-Module: cluster.git X-Git-Refname: refs/heads/STABLE3 X-Git-Reftype: branch X-Git-Oldrev: 96643d0de820ef72c6e93736bcd5a01b72ff5d89 X-Git-Newrev: e467f34fea8c00f4279eb008ab4506000b5723fe From: Christine Caulfield Message-Id: <20090311114251.067561201EB@lists.fedorahosted.org> Date: Wed, 11 Mar 2009 11:43:00 -0000 X-Scanned-By: MIMEDefang 2.58 on 172.16.52.254 Mailing-List: contact cluster-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: cluster-cvs-owner@sourceware.org X-SW-Source: 2009-q1/txt/msg00736.txt.bz2 Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=e467f34fea8c00f4279eb008ab4506000b5723fe Commit: e467f34fea8c00f4279eb008ab4506000b5723fe Parent: 96643d0de820ef72c6e93736bcd5a01b72ff5d89 Author: Christine Caulfield AuthorDate: Wed Mar 11 11:42:24 2009 +0000 Committer: Christine Caulfield CommitterDate: Wed Mar 11 11:42:24 2009 +0000 config: make confdb2ldap compile with latest corosync Signed-off-by: Christine Caulfield --- config/tools/ldap/confdb2ldif.c | 33 ++++++++++++++++----------------- 1 files changed, 16 insertions(+), 17 deletions(-) diff --git a/config/tools/ldap/confdb2ldif.c b/config/tools/ldap/confdb2ldif.c index 0606d7e..5086a22 100644 --- a/config/tools/ldap/confdb2ldif.c +++ b/config/tools/ldap/confdb2ldif.c @@ -7,7 +7,6 @@ #include #include -#include #include confdb_callbacks_t callbacks = { @@ -55,9 +54,9 @@ static char *ldap_attr_name(char *attrname) /* Recursively dump the object tree */ -static void print_config_tree(confdb_handle_t handle, unsigned int parent_object_handle, char *dn, char *fulldn) +static void print_config_tree(confdb_handle_t handle, hdb_handle_t parent_object_handle, char *dn, char *fulldn) { - unsigned int object_handle; + hdb_handle_t object_handle; char object_name[1024]; int object_name_len; char key_name[1024]; @@ -73,13 +72,13 @@ static void print_config_tree(confdb_handle_t handle, unsigned int parent_object /* Show the keys */ res = confdb_key_iter_start(handle, parent_object_handle); - if (res != SA_AIS_OK) { - printf( "error resetting key iterator for object %d: %d\n", parent_object_handle, res); + if (res != CS_OK) { + printf( "error resetting key iterator for object %llu: %d\n", parent_object_handle, res); return; } while ( (res = confdb_key_iter(handle, parent_object_handle, key_name, &key_name_len, - key_value, &key_value_len)) == SA_AIS_OK) { + key_value, &key_value_len)) == CS_OK) { key_name[key_name_len] = '\0'; key_value[key_value_len] = '\0'; @@ -104,17 +103,17 @@ static void print_config_tree(confdb_handle_t handle, unsigned int parent_object /* Show sub-objects */ res = confdb_object_iter_start(handle, parent_object_handle); - if (res != SA_AIS_OK) { - printf( "error resetting object iterator for object %d: %d\n", parent_object_handle, res); + if (res != CS_OK) { + printf( "error resetting object iterator for object %llu: %d\n", parent_object_handle, res); return; } - while ( (res = confdb_object_iter(handle, parent_object_handle, &object_handle, object_name, &object_name_len)) == SA_AIS_OK) { - unsigned int parent; + while ( (res = confdb_object_iter(handle, parent_object_handle, &object_handle, object_name, &object_name_len)) == CS_OK) { + hdb_handle_t parent; res = confdb_object_parent_get(handle, object_handle, &parent); - if (res != SA_AIS_OK) { - printf( "error getting parent for object %d: %d\n", object_handle, res); + if (res != CS_OK) { + printf( "error getting parent for object %llu: %d\n", object_handle, res); return; } @@ -122,7 +121,7 @@ static void print_config_tree(confdb_handle_t handle, unsigned int parent_object /* Check for "name", and create dummy parent object */ res = confdb_key_get(handle, object_handle, "name", strlen("name"), key_value, &key_value_len); - if (res == SA_AIS_OK) { + if (res == CS_OK) { sprintf(cumulative_dn, "cn=%s,%s", object_name, fulldn); printf("\n"); printf("dn: %s\n", cumulative_dn); @@ -145,7 +144,7 @@ int main(int argc, char *argv[]) { confdb_handle_t handle; int result; - unsigned int cluster_handle; + hdb_handle_t cluster_handle; char *clusterroot = "cluster"; char basedn[1024]; @@ -167,7 +166,7 @@ int main(int argc, char *argv[]) } result = confdb_initialize (&handle, &callbacks); - if (result != SA_AIS_OK) { + if (result != CS_OK) { printf ("Could not initialize Cluster Configuration Database API instance error %d\n", result); exit (1); } @@ -175,13 +174,13 @@ int main(int argc, char *argv[]) /* Find the starting object ... this should be a param */ result = confdb_object_find_start(handle, OBJECT_PARENT_HANDLE); - if (result != SA_AIS_OK) { + if (result != CS_OK) { printf ("Could not start object_find %d\n", result); exit (1); } result = confdb_object_find(handle, OBJECT_PARENT_HANDLE, clusterroot, strlen(clusterroot), &cluster_handle); - if (result != SA_AIS_OK) { + if (result != CS_OK) { printf ("Could not object_find \"cluster\": %d\n", result); exit (1); }