From mboxrd@z Thu Jan 1 00:00:00 1970 From: pcaulfield@sourceware.org Date: 19 Feb 2007 13:14:44 -0000 Subject: [Cluster-devel] cluster/cman/cman_tool join.c Message-ID: <20070219131444.22919.qmail@sourceware.org> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit CVSROOT: /cvs/cluster Module name: cluster Branch: RHEL5 Changes by: pcaulfield at sourceware.org 2007-02-19 13:14:43 Modified files: cman/cman_tool : join.c Log message: If exec fails then tell the parent process. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/cman_tool/join.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.47.2.1&r2=1.47.2.2 --- cluster/cman/cman_tool/join.c 2006/12/12 16:51:10 1.47.2.1 +++ cluster/cman/cman_tool/join.c 2007/02/19 13:14:42 1.47.2.2 @@ -139,7 +139,11 @@ be_daemon(!comline->verbose); chdir(SBINDIR); execve("./aisexec", argv, envp); - die("execve of " SBINDIR "/aisexec failed: %s", strerror(errno)); + + // exec failed - tell the parent process */ + sprintf(scratch, "execve of " SBINDIR "/aisexec failed: %s", strerror(errno)); + write(p[1], scratch, strlen(scratch)); + exit(1); break; default: //parent @@ -169,7 +173,7 @@ } else { int pidstatus; - if (waitpid(aisexec_pid, &pidstatus, WNOHANG) == 0) + if (waitpid(aisexec_pid, &pidstatus, WNOHANG) == 0 && pidstatus != 0) fprintf(stderr, "cman died with status: %d\n", WEXITSTATUS(pidstatus)); else status = 0; /* Try to connect */