[PATCH] ctdb: Fix the O3 developer build

Volker Lendecke Volker.Lendecke at SerNet.DE
Tue Apr 21 02:35:59 MDT 2015


Hi!

Review&push appreciated!

Thanks,

Volker

-- 
SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
http://www.sernet.de, mailto:kontakt at sernet.de
-------------- next part --------------
From cefea14827bc86498d503397bf7e8d91c9d3c3ff Mon Sep 17 00:00:00 2001
From: Volker Lendecke <vl at samba.org>
Date: Tue, 21 Apr 2015 10:34:54 +0200
Subject: [PATCH] ctdb: Fix the O3 developer build

Signed-off-by: Volker Lendecke <vl at samba.org>
---
 ctdb/client/ctdb_client.c |    2 +-
 ctdb/tools/ctdb.c         |   20 ++++++++++----------
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/ctdb/client/ctdb_client.c b/ctdb/client/ctdb_client.c
index f46cfc6..6e18269 100644
--- a/ctdb/client/ctdb_client.c
+++ b/ctdb/client/ctdb_client.c
@@ -3873,7 +3873,7 @@ static bool server_id_exists(struct ctdb_context *ctdb, struct server_id *id)
 {
 	struct ctdb_server_id sid;
 	int ret;
-	uint32_t result;
+	uint32_t result = 0;
 
 	sid.type = SERVER_TYPE_SAMBA;
 	sid.pnn = id->vnn;
diff --git a/ctdb/tools/ctdb.c b/ctdb/tools/ctdb.c
index 66d0383..9b7fb11 100644
--- a/ctdb/tools/ctdb.c
+++ b/ctdb/tools/ctdb.c
@@ -340,7 +340,7 @@ static bool db_exists(struct ctdb_context *ctdb, const char *dbarg,
 	bool dbid_given = false, found = false;
 	uint32_t id;
 	TALLOC_CTX *tmp_ctx = talloc_new(ctdb);
-	const char *name;
+	const char *name = NULL;
 
 	ret = ctdb_ctrl_getdbmap(ctdb, TIMELIMIT(), options.pnn, tmp_ctx, &dbmap);
 	if (ret != 0) {
@@ -2803,7 +2803,7 @@ static int unregsrvid(struct ctdb_context *ctdb, int argc, const char **argv)
  */
 static int chksrvid(struct ctdb_context *ctdb, int argc, const char **argv)
 {
-	uint32_t status;
+	uint32_t status = 0;
 	int ret;
 	struct ctdb_server_id server_id;
 
@@ -4589,9 +4589,9 @@ static int control_getdbmap(struct ctdb_context *ctdb, int argc, const char **ar
 	if(options.machinereadable){
 		printm(":ID:Name:Path:Persistent:Sticky:Unhealthy:ReadOnly:\n");
 		for(i=0;i<dbmap->num;i++){
-			const char *path;
-			const char *name;
-			const char *health;
+			const char *path = NULL;
+			const char *name = NULL;
+			const char *health = NULL;
 			bool persistent;
 			bool readonly;
 			bool sticky;
@@ -4615,9 +4615,9 @@ static int control_getdbmap(struct ctdb_context *ctdb, int argc, const char **ar
 
 	printf("Number of databases:%d\n", dbmap->num);
 	for(i=0;i<dbmap->num;i++){
-		const char *path;
-		const char *name;
-		const char *health;
+		const char *path = NULL;
+		const char *name = NULL;
+		const char *health = NULL;
 		bool persistent;
 		bool readonly;
 		bool sticky;
@@ -4647,8 +4647,8 @@ static int control_getdbstatus(struct ctdb_context *ctdb, int argc, const char *
 	const char *db_name;
 	uint32_t db_id;
 	uint8_t flags;
-	const char *path;
-	const char *health;
+	const char *path = NULL;
+	const char *health = NULL;
 
 	if (argc < 1) {
 		usage();
-- 
1.7.10.4



More information about the samba-technical mailing list