Skip to content

Commit

Permalink
EV might steal our exit status
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Aug 29, 2016
1 parent 153a606 commit c7a7b66
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Changes
@@ -1,5 +1,7 @@

7.05 2016-08-29
- Fixed bug in Mojo::IOLoop::Subprocess where EV would steal the subprocess
exit status.

7.04 2016-08-28
- Added EXPERIMENTAL support for performing computationally expensive
Expand Down
4 changes: 2 additions & 2 deletions lib/Mojo/IOLoop/Subprocess.pm
Expand Up @@ -40,8 +40,8 @@ sub run {
$stream->on(read => sub { $buffer .= pop });
$stream->on(
close => sub {
waitpid $self->{pid}, 0;
return $self->$parent("Non-zero exit status (@{[$? >> 8]})") if $?;
return $self->$parent("Non-zero exit status (@{[$? >> 8]})")
if waitpid($self->{pid}, 0) > 0 && $?;
my $results = eval { $self->deserialize->($buffer) } || [];
$self->$parent(shift(@$results) // $@, @$results);
}
Expand Down

0 comments on commit c7a7b66

Please sign in to comment.