Skip to content

Commit

Permalink
Merge branch 'Fix_race_conditionon_EOF'
Browse files Browse the repository at this point in the history
  • Loading branch information
7ail committed Sep 18, 2019
2 parents b5e15fb + 26baa44 commit 1bb02a2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions jqpipe.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ func (p *Pipe) Next() (json.RawMessage, error) {
}
p.stdout.Close()

if err == io.EOF {
p.jq.Wait()
return nil, err
}

// if we have a decoding error, jq is sick and we need to kill it with fire..
if err != io.EOF {
p.Close()
Expand Down

0 comments on commit 1bb02a2

Please sign in to comment.