public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
* cluster: master - libcman: Return normal error codes
@ 2009-06-24 14:34 Christine Caulfield
  0 siblings, 0 replies; only message in thread
From: Christine Caulfield @ 2009-06-24 14:34 UTC (permalink / raw)
  To: cluster-cvs-relay

Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=ecf3d8c8331110f783ce064eefe4a9e278d38755
Commit:        ecf3d8c8331110f783ce064eefe4a9e278d38755
Parent:        a977cbca172502b5d25e8d2ed915a2e39266f17c
Author:        Christine Caulfield <ccaulfie@redhat.com>
AuthorDate:    Wed Jun 24 15:32:55 2009 +0100
Committer:     Christine Caulfield <ccaulfie@redhat.com>
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 <ccaulfie@redhat.com>
---
 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);


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-06-24 14:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-24 14:34 cluster: master - libcman: Return normal error codes Christine Caulfield

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).