Skip to content

Commit e9f280b

Browse files
committed
waitpid for the man process to exit
Without waiting on the forked process, we may check the status of the wrong $?. from millert@openbsd
1 parent 74e5032 commit e9f280b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/Pod/Perldoc/ToMan.pm

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,9 @@ sub _filter_through_nroff {
358358
length $done
359359
);
360360

361+
# wait for it to exit
362+
waitpid( $pid, 0 );
363+
361364
if( $? ) {
362365
$self->warn( "Error from pipe to $render!\n" );
363366
$self->debug( 'Error: ' . do { local $/; <$err> } );

0 commit comments

Comments
 (0)