public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
From: Lon Hohberger <lon@fedoraproject.org>
To: cluster-cvs-relay@redhat.com
Subject: fence: master - fence: Make fence_node return 2 for no fencing
Date: Tue, 23 Jun 2009 15:37:00 -0000	[thread overview]
Message-ID: <20090623153644.EF5E7120255@lists.fedorahosted.org> (raw)

Gitweb:        http://git.fedorahosted.org/git/fence.git?p=fence.git;a=commitdiff;h=30984aa352cc3990bdfbad25624216669062953a
Commit:        30984aa352cc3990bdfbad25624216669062953a
Parent:        e296c0b14d393b341e12d935141d7f592b9ecc0c
Author:        Lon Hohberger <lhh@redhat.com>
AuthorDate:    Tue Jun 23 11:10:34 2009 -0400
Committer:     Lon Hohberger <lhh@redhat.com>
CommitterDate: Tue Jun 23 11:36:34 2009 -0400

fence: Make fence_node return 2 for no fencing

This makes fence_node return values consistent
between fencing and unfencing cases.

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

diff --git a/fence/fence_node/fence_node.c b/fence/fence_node/fence_node.c
index 4cc533d..e7b147c 100644
--- a/fence/fence_node/fence_node.c
+++ b/fence/fence_node/fence_node.c
@@ -227,7 +227,11 @@ int main(int argc, char *argv[])
 			rv = EXIT_SUCCESS;
 		}
 	} else {
-		if (error) {
+		if (error == -2) {
+			fprintf(stderr, "fence %s undefined\n", victim);
+			logt_print(LOG_ERR, "fence %s undefined\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 4fa10cd..c454f1b 100644
--- a/fence/libfence/agent.c
+++ b/fence/libfence/agent.c
@@ -309,7 +309,7 @@ int fence_node(char *victim, struct fence_log *log, int log_size,
 			left--;
 		}
 		count++;
-		error = -1;
+		error = -2;		/* No fencing */
 		goto out;
 	}
 


                 reply	other threads:[~2009-06-23 15:37 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20090623153644.EF5E7120255@lists.fedorahosted.org \
    --to=lon@fedoraproject.org \
    --cc=cluster-cvs-relay@redhat.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).