From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21776 invoked by alias); 24 Jun 2009 14:34:33 -0000 Received: (qmail 21770 invoked by alias); 24 Jun 2009 14:34:32 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS X-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS X-Spam-Check-By: sourceware.org X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bastion2.fedora.phx.redhat.com Subject: cluster: master - libcman: Return normal error codes To: cluster-cvs-relay@redhat.com X-Project: Cluster Project X-Git-Module: cluster.git X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: a977cbca172502b5d25e8d2ed915a2e39266f17c X-Git-Newrev: ecf3d8c8331110f783ce064eefe4a9e278d38755 From: Christine Caulfield Message-Id: <20090624143352.C7AEF120263@lists.fedorahosted.org> Date: Wed, 24 Jun 2009 14:34: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-q2/txt/msg00752.txt.bz2 Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=ecf3d8c8331110f783ce064eefe4a9e278d38755 Commit: ecf3d8c8331110f783ce064eefe4a9e278d38755 Parent: a977cbca172502b5d25e8d2ed915a2e39266f17c Author: Christine Caulfield AuthorDate: Wed Jun 24 15:32:55 2009 +0100 Committer: Christine Caulfield CommitterDate: Wed Jun 24 15:32:55 2009 +0100 libcman: Return normal error codes Although the code in libcman looks like a corosync library in places it should still return unix-standard error codes, not CS_ ones. Signed-off-by: Christine Caulfield --- cman/services/cman/lib/libcman.c | 14 +++++++++----- 1 files changed, 9 insertions(+), 5 deletions(-) diff --git a/cman/services/cman/lib/libcman.c b/cman/services/cman/lib/libcman.c index 13c09c4..aed5626 100644 --- a/cman/services/cman/lib/libcman.c +++ b/cman/services/cman/lib/libcman.c @@ -757,7 +757,8 @@ int cman_dispatch ( dispatch_types != CS_DISPATCH_ALL && dispatch_types != CS_DISPATCH_BLOCKING) { - return (CS_ERR_INVALID_PARAM); + errno = EINVAL; + return -1; } cman_inst = (struct cman_inst *)handle; @@ -787,9 +788,10 @@ int cman_dispatch ( } if (dispatch_avail == -1) { if (cman_inst->finalize == 1) { - error = CS_OK; + error = 0; } else { - error = CS_ERR_LIBRARY; + errno = EINVAL; + error = -1; } goto error_put; } @@ -814,7 +816,8 @@ int cman_dispatch ( break; default: - error = CS_ERR_LIBRARY; + error = -1; + errno = EINVAL; goto error_put; break; } @@ -954,7 +957,8 @@ int cman_set_version(cman_handle_t handle, const cman_version_t *version) } if (confdb_reload(confdb_handle, 0, error, sizeof(error)) != CS_OK) { - ret = EINVAL; + errno = EINVAL; + ret = -1; } confdb_finalize(confdb_handle);