This is the mail archive of the cluster-cvs@sourceware.org mailing list for the cluster.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

cluster: STABLE3 - fence_vmware: Fix VMware helper script to forcestdout close


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=8c761c8c9a6743a731c86e1c01c5addc394ddd0a
Commit:        8c761c8c9a6743a731c86e1c01c5addc394ddd0a
Parent:        ddce1d9b45dfead4807d22dd6101a3e50de7c943
Author:        Jan Friesse <jfriesse@redhat.com>
AuthorDate:    Fri Feb 20 09:19:05 2009 +0100
Committer:     Jan Friesse <jfriesse@redhat.com>
CommitterDate: Fri Feb 20 09:22:45 2009 +0100

fence_vmware: Fix VMware helper script to force stdout close

This feature is advise from Jim Meyering. On the beginning
of script, we register end callback, which close stdout and
show error, if this wasn't successful.
---
 fence/agents/vmware/fence_vmware_helper.pl |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/fence/agents/vmware/fence_vmware_helper.pl b/fence/agents/vmware/fence_vmware_helper.pl
index 5715d55..815728d 100644
--- a/fence/agents/vmware/fence_vmware_helper.pl
+++ b/fence/agents/vmware/fence_vmware_helper.pl
@@ -3,6 +3,15 @@
 use strict;
 use warnings;
 
+my $ME = $0;
+
+END {
+  defined fileno STDOUT or return;
+  close STDOUT and return;
+  warn "$ME: failed to close standard output: $!\n";
+  $? ||= 1;
+}
+
 my ($RELEASE_VERSION, $REDHAT_COPYRIGHT, $BUILD_DATE);
 
 #BEGIN_VERSION_GENERATION


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]