Skip to content

Commit

Permalink
Use WNOHANG, which should work even for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
briandfoy committed Dec 7, 2023
1 parent 630e6d6 commit 7c0a500
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/Pod/Perldoc/ToMan.pm
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package Pod::Perldoc::ToMan;
use strict;
use warnings;
use parent qw(Pod::Perldoc::BaseTo);
use POSIX qw( WNOHANG );

use vars qw($VERSION);
$VERSION = '3.28';
Expand Down Expand Up @@ -362,7 +363,7 @@ sub _filter_through_nroff {
);

# wait for it to exit
waitpid( $pid, 0 ) unless $^O eq 'MSWin32'; # see perlport, this will hang on Windows
waitpid( $pid, WNOHANG );

if( $? ) {
$self->warn( "Error from pipe to $render!\n" );
Expand Down
3 changes: 2 additions & 1 deletion t/lib/TestUtils.pm
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use Data::Dumper;
use Exporter qw(import);
use File::Spec::Functions qw(catfile);
use IPC::Open3;
use POSIX qw( WNOHANG );
use Symbol;

our @EXPORT = qw(
Expand Down Expand Up @@ -36,7 +37,7 @@ sub run_perldoc {
my $success = length($at) == 0;

return { success => !!0 } unless $pid;
waitpid( $pid, 0 ) unless $^O eq 'MSWin32'; # see perlport, this will hang
waitpid( $pid, WNOHANG );

my $output = do { local $/; <$child_out> };
my $error = do { local $/; <$child_err> };
Expand Down

0 comments on commit 7c0a500

Please sign in to comment.