public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
* fence-agents: master - fence_vmware: Fix VMware helper script to force stdout close
@ 2009-02-20  8:20 Jan Friesse
  0 siblings, 0 replies; only message in thread
From: Jan Friesse @ 2009-02-20  8:20 UTC (permalink / raw)
  To: cluster-cvs-relay

Gitweb:        http://git.fedorahosted.org/git/fence-agents.git?p=fence-agents.git;a=commitdiff;h=172523ace63c4c07dd8f4b24135eca2299797432
Commit:        172523ace63c4c07dd8f4b24135eca2299797432
Parent:        fe01865cf8a2f8535c865c4332952863230c2718
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:19:05 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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-02-20  8:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-20  8:20 fence-agents: master - fence_vmware: Fix VMware helper script to force stdout close Jan Friesse

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).