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

[Cluster-devel] [PATCH] fence: Make fence_node return 2 for no fencing



Signed-off-by: Lon Hohberger <lhh redhat com>
---
 fence/fence_node/fence_node.c |    9 ++++++++-
 fence/libfence/agent.c        |    2 +-
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/fence/fence_node/fence_node.c b/fence/fence_node/fence_node.c
index 98d67c6..1a56078 100644
--- a/fence/fence_node/fence_node.c
+++ b/fence/fence_node/fence_node.c
@@ -225,7 +225,14 @@ int main(int argc, char *argv[])
 			rv = EXIT_SUCCESS;
 		}
 	} else {
-		if (error) {
+		if (error == -2) {
+			fprintf(stderr, "fence %s failed: no fencing defined\n",
+				victim);
+			logt_print(LOG_ERR,
+				   "fence %s failed: no fencing defined\n",
+				   victim);
+			rv = 2;
+		} else if (error) {
 			fprintf(stderr, "fence %s failed\n", victim);
 			logt_print(LOG_ERR, "fence %s failed\n", victim);
 			rv = EXIT_FAILURE;
diff --git a/fence/libfence/agent.c b/fence/libfence/agent.c
index 57163aa..49e6795 100644
--- a/fence/libfence/agent.c
+++ b/fence/libfence/agent.c
@@ -307,7 +307,7 @@ int fence_node(char *victim, struct fence_log *log, int log_size,
 			left--;
 		}
 		count++;
-		error = -1;
+		error = -2;		/* No fencing */
 		goto out;
 	}
 
-- 
1.6.0.6


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