[Rt-commit] rt branch, 3.8-trunk, updated. rt-3.8.7-366-g725318d

? sunnavy sunnavy at bestpractical.com
Tue Apr 27 18:52:14 EDT 2010


The branch, 3.8-trunk has been updated
       via  725318d62ce99aee6fe4eeb0a151fb9315d12b34 (commit)
      from  ea2f91d4b9ed106450ace00ad9b53e03b47f7ebe (commit)

Summary of changes:
 lib/RT/Util.pm |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

- Log -----------------------------------------------------------------
commit 725318d62ce99aee6fe4eeb0a151fb9315d12b34
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Wed Apr 28 06:52:03 2010 +0800

    revert to the old stdout explicitly

diff --git a/lib/RT/Util.pm b/lib/RT/Util.pm
index 03d27a3..45ba030 100644
--- a/lib/RT/Util.pm
+++ b/lib/RT/Util.pm
@@ -101,6 +101,7 @@ sub _safe_run_child {
     $stdin->fdopen( 0, 'r' );
     local *STDIN = $stdin;
 
+    my $old_stdout = select;
     my $stdout = IO::Handle->new;
     $stdout->fdopen( 1, 'w' );
     local *STDOUT = $stdout;
@@ -109,7 +110,14 @@ sub _safe_run_child {
     $stderr->fdopen( 2, 'w' );
     local *STDERR = $stderr;
 
-    return shift->();
+    my @return = shift->();
+
+    # no idea why
+    # but if we don't restore $old_stdout, t/web/command_line.t will cry
+    # you can run t/web/command_line.t with GnuPG enabled to reproduce this.
+    select $old_stdout;
+
+    return @return;
 }
 
 eval "require RT::Util_Vendor";

-----------------------------------------------------------------------


More information about the Rt-commit mailing list