From: Andrew Ruthven Date: Tue, 29 Jul 2008 20:53:21 +0000 (+1200) Subject: Hide any warning messages that come out of XML::LibXML. X-Git-Tag: debian-0.9.0-2~7 X-Git-Url: http://git.etc.gen.nz/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a0677539f48597c4d71e5c66ad571581de9408bc;p=mythtv-status.git Hide any warning messages that come out of XML::LibXML. XML::LibXML is very verbose about any little issues it encounters, just hide them. In this case this is to fix encountering an unknown unicode character - � . --- diff --git a/bin/mythtv-status b/bin/mythtv-status index 26901da..74892da 100755 --- a/bin/mythtv-status +++ b/bin/mythtv-status @@ -555,8 +555,15 @@ sub load_xml { clean_xml(\$status); + # Try and hide any error messages thar XML::LibXML insists on printing out. + open my $olderr, ">&STDERR"; + open(STDERR, "> /dev/null") || die "Can't redirect stderr to /dev/null: $!"; + my $xml = eval { $parser->parse_string( $status ) }; + close (STDERR); + open (STDERR, ">&$olderr"); + if ($@) { die "Failed to parse XML: $@\n"; }