Skip to content

Commit

Permalink
Moved call to waitpid() to inside _enter_cmd()
Browse files Browse the repository at this point in the history
  • Loading branch information
soh-cah-toa committed Jul 3, 2011
1 parent 77167c2 commit 64fea2a
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions lib/Parrot/Test/HBDB.pm
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,6 @@ sub cmd_output_is {

_enter_cmd($self->{cmd});

# Wait for HBDB to terminate
waitpid $pid, 0;

# Add HBDB_STDOUT and HBDB_STDERR to IO::Select object
my $select = IO::Select->new();
$select->add(\*HBDB_STDOUT, \*HBDB_STDERR);
Expand Down Expand Up @@ -218,9 +215,6 @@ sub cmd_output_like {

_enter_cmd($self->{cmd});

# Wait for HBDB to terminate
waitpid $pid, 0;

# Add HBDB_STDOUT and HBDB_STDERR to IO::Select object
my $select = IO::Select->new();
$select->add(\*HBDB_STDOUT, \*HBDB_STDERR);
Expand Down Expand Up @@ -276,8 +270,12 @@ sub _close_fh {
sub _enter_cmd {
my $cmd = shift || '';

# Write command then send EOF so HBDB quits
print HBDB_STDIN "$cmd\n";
close HBDB_STDIN;

# Wait for HBDB to terminate
waitpid $pid, 0;
}

sub _generate_pbc {
Expand Down

0 comments on commit 64fea2a

Please sign in to comment.