From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24893 invoked by alias); 13 Aug 2009 13:56:20 -0000 Received: (qmail 24882 invoked by alias); 13 Aug 2009 13:56:20 -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: master - cman: fix error if corosync takes >1s to start up To: cluster-cvs-relay@redhat.com X-Project: Cluster Project X-Git-Module: cluster.git X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 654431f62a8bfe45cb8c7d2a9dd2f407d978a325 X-Git-Newrev: af693a731caa56bc18870c1dc61da04ecef245c7 From: Christine Caulfield Message-Id: <20090813135558.D59A5120202@lists.fedorahosted.org> Date: Thu, 13 Aug 2009 13:56:00 -0000 X-Scanned-By: MIMEDefang 2.58 on 172.16.52.254 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/msg00199.txt.bz2 Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=af693a731caa56bc18870c1dc61da04ecef245c7 Commit: af693a731caa56bc18870c1dc61da04ecef245c7 Parent: 654431f62a8bfe45cb8c7d2a9dd2f407d978a325 Author: Christine Caulfield AuthorDate: Thu Aug 13 14:52:58 2009 +0100 Committer: Christine Caulfield CommitterDate: Thu Aug 13 14:55:29 2009 +0100 cman: fix error if corosync takes >1s to start up If corosync takes too long to start up then cman_tool quits with an error saying that it didn't start. This fixes that by correcting the abuses of the select return status. Signed-off-by: Christine Caulfield --- cman/cman_tool/join.c | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff --git a/cman/cman_tool/join.c b/cman/cman_tool/join.c index 630e31a..fed729c 100644 --- a/cman/cman_tool/join.c +++ b/cman/cman_tool/join.c @@ -272,7 +272,7 @@ int join(commandline_t *comline, char *main_envp[]) if (sscanf(messageptr, "FORKED: %d", &corosync_pid) == 1) { if (comline->verbose & DEBUG_STARTUP_ONLY) fprintf(stderr, "forked process ID is %d\n", corosync_pid); - status = 1; + status = 0; /* There might be a SUCCESS or error message in the pipe too. */ messageptr = strchr(messageptr, '\n'); @@ -285,7 +285,6 @@ int join(commandline_t *comline, char *main_envp[]) if (sscanf(messageptr, "SUCCESS: %d", &corosync_pid) == 1) { if (comline->verbose & DEBUG_STARTUP_ONLY) fprintf(stderr, "corosync running, process ID is %d\n", corosync_pid); - status = 0; break; } else if (messageptr) { @@ -301,7 +300,7 @@ int join(commandline_t *comline, char *main_envp[]) } } - } while (status != 0); + } while (status == 0); close(p[0]); /* If corosync has started, try to connect to cman ... if it's still there */