[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Cluster-devel] cluster/fence/fence_node fence_node.c



CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	fabbione 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);
+	}
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]