This is the mail archive of the
cluster-cvs@sourceware.org
mailing list for the cluster.
cluster: STABLE3 - cman: More join wait fixes
- From: Christine Caulfield <chrissie at fedoraproject dot org>
- To: cluster-cvs-relay at redhat dot com
- Date: Thu, 20 Aug 2009 07:23:35 +0000 (UTC)
- Subject: cluster: STABLE3 - cman: More join wait fixes
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;
}
}