[Ocfs2-tools-devel] [PATCH 1/2] ocfs2_controld: Don't print hard-coded stack name

Mark Fasheh mfasheh at suse.com
Thu Aug 14 15:37:49 PDT 2008


From: Andrew Beekhof <abeekhof at suse.de>

Signed-off-by: Andrew Beekhof <abeekhof at suse.de>
Signed-off-by: Mark Fasheh <mfasheh at suse.com>
---
 ocfs2_controld/cman.c           |    1 +
 ocfs2_controld/main.c           |    6 +++---
 ocfs2_controld/ocfs2_controld.h |    1 +
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/ocfs2_controld/cman.c b/ocfs2_controld/cman.c
index faf69c3..0c5aa61 100644
--- a/ocfs2_controld/cman.c
+++ b/ocfs2_controld/cman.c
@@ -48,6 +48,7 @@ static int              old_node_count;
 static cman_node_t      cman_nodes[O2NM_MAX_NODES];
 static int              cman_node_count;
 
+const char *stackname = "cman";
 
 int kill_stack_node(int nodeid)
 {
diff --git a/ocfs2_controld/main.c b/ocfs2_controld/main.c
index ac2dbb5..f2ca611 100644
--- a/ocfs2_controld/main.c
+++ b/ocfs2_controld/main.c
@@ -1136,9 +1136,9 @@ int main(int argc, char **argv)
 		com_err(prog_name, err, "while determining the current cluster stack");
 		return 1;
 	}
-	if (strcmp(stack, "cman")) {
-		fprintf(stderr, "%s: This daemon supports the \"cman\" stack, but the \"%s\" stack is in use\n",
-			prog_name, stack);
+	if (strcmp(stack, stackname)) {
+		fprintf(stderr, "%s: This daemon supports the \"%s\" stack, but the \"%s\" stack is in use\n",
+			prog_name, stackname, stack);
 		return 1;
 	}
 
diff --git a/ocfs2_controld/ocfs2_controld.h b/ocfs2_controld/ocfs2_controld.h
index 8243513..5cbb7c0 100644
--- a/ocfs2_controld/ocfs2_controld.h
+++ b/ocfs2_controld/ocfs2_controld.h
@@ -38,6 +38,7 @@ extern char dump_buf[DUMP_SIZE];
 extern int dump_point;
 extern int dump_wrap;
 extern int our_nodeid;
+extern const char *stackname;
 
 extern void daemon_dump_save(void);
 
-- 
1.5.4.1




More information about the Ocfs2-tools-devel mailing list