cluster: master - libcman: Return normal error codes
Christine Caulfield
chrissie@fedoraproject.org
Wed Jun 24 14:34:00 GMT 2009
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);
More information about the Cluster-cvs
mailing list