This is the mail archive of the cluster-cvs@sourceware.org mailing list for the cluster.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

master - libccs: cleanup


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=2867054d4ed23f26cb1afb1801505427005e43e0
Commit:        2867054d4ed23f26cb1afb1801505427005e43e0
Parent:        4f0d4ea06e11c8ccec56bc1abf7fbde880e7f969
Author:        Fabio M. Di Nitto <fdinitto@redhat.com>
AuthorDate:    Mon Nov 10 16:44:27 2008 +0100
Committer:     Fabio M. Di Nitto <fdinitto@redhat.com>
CommitterDate: Mon Nov 10 16:44:27 2008 +0100

libccs: cleanup

fix return code

init var

fix comments

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
---
 config/libs/libccsconfdb/fullxpath.c |    2 +-
 config/libs/libccsconfdb/libccs.c    |    4 ++--
 config/libs/libccsconfdb/xpathlite.c |    4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/config/libs/libccsconfdb/fullxpath.c b/config/libs/libccsconfdb/fullxpath.c
index 96aa62e..403744d 100644
--- a/config/libs/libccsconfdb/fullxpath.c
+++ b/config/libs/libccsconfdb/fullxpath.c
@@ -216,7 +216,7 @@ void xpathfull_finish()
  * of the given query.  It is the user's responsibility to ensure that
  * the data returned is freed.
  *
- * Returns: 0 on success, < 0 on failure
+ * Returns: char * to result or NULL in case of failure.
  */
 char *_ccs_get_fullxpath(confdb_handle_t handle, unsigned int connection_handle,
 			 const char *query, int list)
diff --git a/config/libs/libccsconfdb/libccs.c b/config/libs/libccsconfdb/libccs.c
index d1a7f54..e4bdf4b 100644
--- a/config/libs/libccsconfdb/libccs.c
+++ b/config/libs/libccsconfdb/libccs.c
@@ -536,8 +536,8 @@ static int _ccs_get(int desc, const char *query, char **rtn, int list)
 	int fullxpathint = 0;
 
 	handle = confdb_connect();
-	if (handle <= 0)
-		return handle;
+	if (handle < 0)
+		return -1;
 
 	connection_handle = find_ccs_handle(handle, desc);
 	if (connection_handle == -1)
diff --git a/config/libs/libccsconfdb/xpathlite.c b/config/libs/libccsconfdb/xpathlite.c
index 7a2bc8d..17a14e8 100644
--- a/config/libs/libccsconfdb/xpathlite.c
+++ b/config/libs/libccsconfdb/xpathlite.c
@@ -359,13 +359,13 @@ fail:
  * of the given query.  It is the user's responsibility to ensure that
  * the data returned is freed.
  *
- * Returns: 0 on success, < 0 on failure
+ * Returns: char * to result or NULL in case of failure.
  */
 char *_ccs_get_xpathlite(confdb_handle_t handle, unsigned int connection_handle,
 			 const char *query, int list)
 {
 	char current_query[PATH_MAX];
-	char *datapos, *rtn;
+	char *datapos, *rtn = NULL;
 	char previous_query[PATH_MAX];
 	unsigned int list_handle = 0;
 	unsigned int query_handle = 0;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]