All of lore.kernel.org
 help / color / mirror / Atom feed
From: fabbione@sourceware.org <fabbione@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] cluster/fence/fence_node fence_node.c
Date: 29 Oct 2007 05:48:54 -0000	[thread overview]
Message-ID: <20071029054854.6721.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	fabbione at sourceware.org	2007-10-29 05:48:54

Modified files:
	fence/fence_node: fence_node.c 

Log message:
	Apply, rework and cleanup second part of patch from Marco Ceci to fix 354421

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/fence/fence_node/fence_node.c.diff?cvsroot=cluster&r1=1.9&r2=1.10

--- cluster/fence/fence_node/fence_node.c	2007/08/22 08:58:42	1.9
+++ cluster/fence/fence_node/fence_node.c	2007/10/29 05:48:53	1.10
@@ -18,7 +18,6 @@
 #include <syslog.h>
 
 #include "copyright.cf"
-#include "ccs.h"
 
 #define OPTION_STRING           ("hOuV")
 
@@ -32,9 +31,9 @@
 while (0)
 
 static char *prog_name;
-static int force;
+static int force = 0;
 
-int dispatch_fence_agent(int cd, char *victim);
+int dispatch_fence_agent(char *victim, int force);
 
 static void print_usage(void)
 {
@@ -52,7 +51,7 @@
 
 int main(int argc, char *argv[])
 {
-	int cont = 1, optchar, error, cd;
+	int cont = 1, optchar, error;
 	char *victim = NULL;
 
 	prog_name = argv[0];
@@ -104,30 +103,16 @@
 	if (!victim)
 		die("no node name specified");
 
-	if (force)
-		cd = ccs_force_connect(NULL, 0);
-	else
-		cd = ccs_connect();
-
 	openlog("fence_node", LOG_PID, LOG_USER);
 
-	if (cd < 0) {
-		syslog(LOG_ERR, "cannot connect to ccs %d\n", cd);
-		goto fail;
-	}
+	error = dispatch_fence_agent(victim, force);
 
-	error = dispatch_fence_agent(cd, victim);
-	if (error)
-		goto fail_ccs;
-
-	syslog(LOG_NOTICE, "Fence of \"%s\" was successful\n", victim);
-	ccs_disconnect(cd);
-	exit(EXIT_SUCCESS);
-
- fail_ccs:
-	ccs_disconnect(cd);
- fail:
-	syslog(LOG_ERR, "Fence of \"%s\" was unsuccessful\n", victim);
-	exit(EXIT_FAILURE);
+	if (error) {
+		syslog(LOG_ERR, "Fence of \"%s\" was unsuccessful\n", victim);
+		exit(EXIT_FAILURE);
+	} else {
+		syslog(LOG_NOTICE, "Fence of \"%s\" was successful\n", victim);
+		exit(EXIT_SUCCESS);
+	}
 }
 



             reply	other threads:[~2007-10-29  5:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-29  5:48 fabbione [this message]
  -- strict thread matches above, loose matches on Subject: below --
2006-12-01 19:57 [Cluster-devel] cluster/fence/fence_node fence_node.c rohara
2006-12-01 19:17 rohara
2006-07-10 17:05 rohara
2006-07-07 20:01 teigland
2006-07-07 19:41 teigland
2006-07-07 19:40 teigland

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071029054854.6721.qmail@sourceware.org \
    --to=fabbione@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.