Skip to content

Commit

Permalink
Try a windows fix for IPC::Open3
Browse files Browse the repository at this point in the history
  • Loading branch information
briandfoy committed Jun 17, 2023
1 parent caf1109 commit 376ba56
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion t/bc/ipc-open3.t
Expand Up @@ -24,8 +24,17 @@ sub run_bc {
# https://www.perlmonks.org/?node_id=419919
my( $input ) = @_;

my $child_in = Symbol::gensym();
# https://github.com/perl/perl5/issues/14533
if ($^O eq 'MSWin32') {
use Win32API​::File qw(​:Func :HANDLE_FLAG_);
my $wh = FdGetOsFHandle(fileno $child_in);
SetHandleInformation($wh, HANDLE_FLAG_INHERIT, 0);
die "Can't turn off HANDLE_FLAG_INHERIT​: $@"​;
}

my $pid = IPC::Open3::open3(
my $child_in = Symbol::gensym(),
$child_in,
my $child_out,
my $child_err = Symbol::gensym(),
$^X, $program, '-'
Expand Down

0 comments on commit 376ba56

Please sign in to comment.