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

Joel Becker Joel.Becker at oracle.com
Thu Aug 14 15:45:45 PDT 2008


On Thu, Aug 14, 2008 at 03:37:49PM -0700, Mark Fasheh wrote:
> 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>
Signed-off-by: Joel Becker <joel.becker at oracle.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
> 
> 
> _______________________________________________
> Ocfs2-tools-devel mailing list
> Ocfs2-tools-devel at oss.oracle.com
> http://oss.oracle.com/mailman/listinfo/ocfs2-tools-devel

-- 

"There is shadow under this red rock.
 (Come in under the shadow of this red rock)
 And I will show you something different from either
 Your shadow at morning striding behind you
 Or your shadow at evening rising to meet you.
 I will show you fear in a handful of dust."

Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127



More information about the Ocfs2-tools-devel mailing list