[padb-devel] [padb] r304 committed - Check for stderr from the minfo process and report it to the user as ...
padb at googlecode.com
padb at googlecode.com
Tue Oct 27 21:49:20 GMT 2009
Revision: 304
Author: apittman
Date: Tue Oct 27 14:48:53 2009
Log: Check for stderr from the minfo process and report it to the user as
a problem if there is any.
http://code.google.com/p/padb/source/detail?r=304
Modified:
/trunk/src/padb
=======================================
--- /trunk/src/padb Tue Oct 27 14:33:16 2009
+++ /trunk/src/padb Tue Oct 27 14:48:53 2009
@@ -5727,8 +5727,10 @@
debug => 0,
};
+ $h->{fd}{err} = *M_ERROR;
+
my $cmd = $inner_conf{minfo};
- $h->{hpid} = open3( $h->{fd}{wtr}, $h->{fd}{rdr}, $h->{fd}{err}, $cmd )
+ $h->{hpid} = open3( $h->{fd}{wtr}, $h->{fd}{rdr}, *M_ERROR, $cmd )
or confess "Unable to popen() h: $!\n";
if ( $h->{debug} ) {
@@ -5870,6 +5872,20 @@
push @{ $cd{raw} }, $r;
}
}
+
+ # Belt and braces approach, minfo shouldn't have any output on
+ # stderr which means that if it does then it's a bug. Check that
+ # and report it to the user as a problem.
+ my $eh = $h->{fd}{err};
+ my $stderr = $EMPTY_STRING;
+ my $have_error_messages = 0;
+ while (<$eh>) {
+ $have_error_messages = 1;
+ $stderr .= $_;
+ }
+ if ($have_error_messages) {
+ target_error( $vp, "Stderr from minfo: $stderr" );
+ }
my $sc = keys %stats;
More information about the padb-devel
mailing list