Stas Bekman wrote:

Steve Hay wrote:
[...]
Any luck with either of the two following patches?

No :-(


I tried them each using a run3 call in TestSmoke.pm that uses a scalar:

   my $log = '';
   run3 $command, undef, \$log, \$log;
   print $log;

and again using a temporary file:

   my ($fh, $file) = tempfile(UNLINK => 1);
   run3 $command, undef, $file, $file;
   local $/;
   my $log = <$fh>;
   close $fh;
   print $log;

both either way both patches still give the "Failed to dup STDOUT" message.

- Steve



Index: src/modules/perl/modperl_io.c
===================================================================
RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_io.c,v
retrieving revision 1.14
diff -u -r1.14 modperl_io.c
--- src/modules/perl/modperl_io.c 3 Oct 2003 17:45:23 -0000 1.14
+++ src/modules/perl/modperl_io.c 6 Oct 2003 19:12:11 -0000
@@ -173,6 +173,8 @@
Perl_croak(aTHX_ "Failed to restore STDIN: %_", get_sv("!", TRUE));
}


+    Perl_do_close(aTHX_ handle, FALSE);
+
     IoFLUSH_off(handle); /* STDIN's $|=0 */

MP_TRACE_o(MP_FUNC, "end\n");
@@ -193,6 +195,8 @@
if (status == 0) {
Perl_croak(aTHX_ "Failed to restore STDOUT: %_", get_sv("!", TRUE));
}
+
+ Perl_do_close(aTHX_ handle, FALSE);


     MP_TRACE_o(MP_FUNC, "end\n");
 }


Index: src/modules/perl/modperl_io.c =================================================================== RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_io.c,v retrieving revision 1.14 diff -u -r1.14 modperl_io.c --- src/modules/perl/modperl_io.c 3 Oct 2003 17:45:23 -0000 1.14 +++ src/modules/perl/modperl_io.c 6 Oct 2003 19:13:25 -0000 @@ -164,7 +164,7 @@

MP_TRACE_o(MP_FUNC, "start");

-    /* Perl_do_close(aTHX_ handle_orig, FALSE); */
+    Perl_do_close(aTHX_ handle_orig, FALSE);

/* open STDIN, "<&STDIN_SAVED" or die "Can't dup STDIN_SAVED: $!"; */
status = Perl_do_open9(aTHX_ handle_orig, "<&", 2, FALSE, O_RDONLY,
@@ -173,6 +173,8 @@
Perl_croak(aTHX_ "Failed to restore STDIN: %_", get_sv("!", TRUE));
}


+    Perl_do_close(aTHX_ handle, FALSE);
+
     IoFLUSH_off(handle); /* STDIN's $|=0 */

     MP_TRACE_o(MP_FUNC, "end\n");
@@ -185,7 +187,7 @@

MP_TRACE_o(MP_FUNC, "start");

-    /* Perl_do_close(aTHX_ handle_orig, FALSE); */
+    Perl_do_close(aTHX_ handle_orig, FALSE);

/* open STDOUT, ">&STDOUT_SAVED" or die "Can't dup STDOUT_SAVED: $!"; */
status = Perl_do_open9(aTHX_ handle_orig, ">&", 2, FALSE, O_WRONLY,
@@ -193,6 +195,8 @@
if (status == 0) {
Perl_croak(aTHX_ "Failed to restore STDOUT: %_", get_sv("!", TRUE));
}
+
+ Perl_do_close(aTHX_ handle, FALSE);


     MP_TRACE_o(MP_FUNC, "end\n");
 }




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to