From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28059 invoked by alias); 20 Aug 2009 07:24:08 -0000 Received: (qmail 28051 invoked by alias); 20 Aug 2009 07:24:07 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS X-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS X-Spam-Check-By: sourceware.org X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bastion2.fedora.phx.redhat.com Subject: cluster: STABLE3 - cman: More join wait fixes To: cluster-cvs-relay@redhat.com X-Project: Cluster Project X-Git-Module: cluster.git X-Git-Refname: refs/heads/STABLE3 X-Git-Reftype: branch X-Git-Oldrev: be5802cb5551e566db3b4423582568a7435138e0 X-Git-Newrev: cd7204afe474d03067e18f7d6786410893620e07 From: Christine Caulfield Message-Id: <20090820072335.B101B120369@lists.fedorahosted.org> Date: Thu, 20 Aug 2009 07:24:00 -0000 X-Scanned-By: MIMEDefang 2.67 on 10.5.11.18 Mailing-List: contact cluster-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: cluster-cvs-owner@sourceware.org X-SW-Source: 2009-q3/txt/msg00223.txt.bz2 Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=cd7204afe474d03067e18f7d6786410893620e07 Commit: cd7204afe474d03067e18f7d6786410893620e07 Parent: be5802cb5551e566db3b4423582568a7435138e0 Author: Christine Caulfield AuthorDate: Thu Aug 20 08:22:47 2009 +0100 Committer: Christine Caulfield CommitterDate: Thu Aug 20 08:22:47 2009 +0100 cman: More join wait fixes If corosync exits with an error, cman_tool join could still try to loop pointlessly looking for a cman handle. Signed-off-by: Christine Caulfield --- cman/cman_tool/join.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cman/cman_tool/join.c b/cman/cman_tool/join.c index 7d9a1dc..02ef73a 100644 --- a/cman/cman_tool/join.c +++ b/cman/cman_tool/join.c @@ -111,7 +111,7 @@ int join(commandline_t *comline, char *main_envp[]) int envptr = 0; int argvptr = 0; char scratch[1024]; - cman_handle_t h; + cman_handle_t h = NULL; int status; pid_t corosync_pid; int p[2]; @@ -269,7 +269,7 @@ int join(commandline_t *comline, char *main_envp[]) /* There might be a SUCCESS or error message in the pipe too. */ messageptr = strchr(messageptr, '\n'); - if (messageptr) + if (messageptr && strlen(messageptr) > 1) messageptr++; else continue; @@ -282,6 +282,7 @@ int join(commandline_t *comline, char *main_envp[]) } else if (messageptr) { fprintf(stderr, "%s\n", messageptr); + status = 1; break; } }