public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
* cluster: STABLE3 - cman: More join wait fixes
@ 2009-08-20  7:24 Christine Caulfield
  0 siblings, 0 replies; only message in thread
From: Christine Caulfield @ 2009-08-20  7:24 UTC (permalink / raw)
  To: cluster-cvs-relay

Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=cd7204afe474d03067e18f7d6786410893620e07
Commit:        cd7204afe474d03067e18f7d6786410893620e07
Parent:        be5802cb5551e566db3b4423582568a7435138e0
Author:        Christine Caulfield <ccaulfie@redhat.com>
AuthorDate:    Thu Aug 20 08:22:47 2009 +0100
Committer:     Christine Caulfield <ccaulfie@redhat.com>
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 <ccaulfie@redhat.com>
---
 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;
 					}
 			}


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-08-20  7:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-20  7:24 cluster: STABLE3 - cman: More join wait fixes Christine Caulfield

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).